custom-object

How to pass custom object with checked checkbox through intent in adapter to activity

老子叫甜甜 提交于 2019-12-12 01:08:00
问题 I am displaying hotels in listview with checkbox,image and text. when user click on checkbox then put that checked hotel_id into bundle. And pass to it's super class. When i am selected hotels and click on button on main activity my logcat shows NullPointerException. I will check my code with debugger. I can find getting Bundle=null. So please help to find the hotel_id when click's on checkbox and send that all selected hotel_id to its main Activity. Here is my ListViewAdapter class. public

How can I optimize compare function for custom date structure?

强颜欢笑 提交于 2019-12-11 23:48:09
问题 I want to sort a vector of date s and I wrote compare function for it: #include <iostream> struct date { int day; int month; int year; }; int compare_dates(date a, date b) { if (a.year < b.year) { return -1; } else if (a.year == b.year) { if (a.month < b.month) { return -1; } else if (a.month == b.month) { if (a.day < b.day) { return -1; } else if (a.day > b.day) { return 1; } } else { return 1; } } else { return 1; } return 0; } int main() { date a = {}; date a.day = 19; date a.month = 11;

Implement Spinner in TableView to show/edit value of custom object

女生的网名这么多〃 提交于 2019-12-11 18:32:30
问题 I have an ObservableList of custom objects RecipeObject_Fermentable , whose properties I am displaying to the user through a TableView . For the most part it works well; when I populate the ObservableList with a new item, the TableView displays its contents. Using the .setCellValueFactory() method for each column allows me to display the simple objects (Strings and Doubles) as text in my TableView very easily. For instance, I can access property ' name ' of type String with... private

How to retrieve related records on Quickblox custom objects?

假装没事ソ 提交于 2019-12-11 08:22:55
问题 I know how to create relation: QBCustomObject customObject = new QBCustomObject("Comment"); // your Class name customObject.put(fieldHealth, 99); customObject.put("text", "The first film in the series was..."); customObject.setParentId("50aa4d8fefa357fa14000001"); QBCustomObjects.createObject(qbCustomObject, new QBCallbackImpl() { @Override public void onComplete(Result result) { if (result.isSuccess()) { QBCustomObjectResult qbCustomObjectResult = (QBCustomObjectResult) result;

How do I access a custom object in memory from a view controller?

不羁的心 提交于 2019-12-11 06:28:43
问题 In my app I fetch a coredatabase and put results into an array called self.stores. I convert those store locations to MyLocation objects which have a distance property. I plot the MyLocation objects like so: - (void)plotStorePositions:(NSString *)responseString { for (id<MKAnnotation> annotation in _mapView.annotations) { [_mapView removeAnnotation:annotation]; } //CYCLE THRU STORE OBJECTS for (Store * storeObject in self.stores) { NSString * latitude = storeObject.latitude; NSString *

Mapping JSON objects in custom objects

风格不统一 提交于 2019-12-09 13:39:49
问题 I've been searching if it is possible to get a JSON dictionary or array and directly map it in a custom object whose properties have the same name as the JSON tags, but I din't find any information regarding that. I've been parsing JSON dictionaries manually, like this: id deserializedObj = nil; id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:&error]; if ([jsonObject isKindOfClass:[NSDictionary class]]) { NSDictionary *jsonDictionary

how to send a custom object as Job Parameter in Spring Batch?

跟風遠走 提交于 2019-12-09 13:07:33
问题 I have a requirement of sending a Custom Object to the Spring Batch Job , where this Object is used continuously used by the Item Processor for the business requirement. How can we send custom object from outside to the Job Context. This Object changes from Job to Job and generated at runtime depending on Business case. How can send this as a Job Parameter? or is there any way that i can set this Object to the respective Job ? can overriding Spring JobParameter help me in any way? or are

WCF returning a custom object with a collection of custom objects containing streams

假装没事ソ 提交于 2019-12-08 11:05:47
问题 I don't know if this could be done, but I have a WCF service that should return a custom object, the object has a collection of another custom object that contains a stream. when I try to return this object I get System.Runtime.Serialization.InvalidDataContractException: Type 'System.ServiceModel.Dispatcher.StreamFormatter+MessageBodyStream' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the

Adding Markers to Google Maps v3 After Map Created

孤街浪徒 提交于 2019-12-08 08:10:55
问题 I'm relatively new with using Google Maps API. Right now I am working on a project where a user can select various search filters and see results automatically show up on the map without reloading the page. My approach thus far has been to create a Javascript object with controls the map so that I could manipulate pieces of it as I wish (ie, centerMap(), addMarker(), clearMap(), etc). I developed several proof-of-concept pieces before beginning this phase of the project. Right now I am at the

iCloud - How to save archive containing array of custom objects

懵懂的女人 提交于 2019-12-06 06:59:27
问题 I have developed a small app that stores locally in iOS through archiving an array of custom objects containing: @property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *dateCreated; @property (nonatomic, copy) NSString *desc; @property (nonatomic, copy) NSString *url; I want to sync said archive using iCloud and I believe the recommended mechanism is through a UIDocument subclass. All UIDocument examples I found utlilized a single instance with 1 single NSString, so