nsmutablearray

How to access array fields in sudzc.com SOAP result?

做~自己de王妃 提交于 2019-12-11 06:20:57
问题 Sorry to perhaps ask stupid questions, but I'm still having issues with Objective-C syntax. So, I've got this SOAP response from my sudzc.com generated code. It should contain a SQL SELECT result with veh_id and version as columns. What I get as a response object is a NSMutableArray, NSMutableArray* soapArray = (NSMutableArray*)value; so I walk through it: unsigned count = [soapArray count]; while (count--) { id myobj = [soapArray objectAtIndex:count]; NSLog(@"myobj: %@", myobj); } What I get

NSUserDefaults and saving size

谁说胖子不能爱 提交于 2019-12-11 05:42:29
问题 I have an app that tracks a user as they drive along. It uses CLLocationManager and each time the didUpdateToLocation is called I save the CLLocation point. A trip of around 25 miles yields somewhere in the neighborhood of 1200 points. As of now I save this array of points to the user defaults for testing. Should I look at CoreData to properly save this information? Or possible just write everything out to a file? My concern is that can NSUserDefaults "max out"? I could potentially have

Objective-C Split an array into two separate arrays based on even/odd indexes

给你一囗甜甜゛ 提交于 2019-12-11 03:51:08
问题 I have an array, NSMutableArray *stringArray that looks like this stringArray = [0]String1 [1]String2 [2]String3 [3]String4 [4]String5 [5]String6 How would I go about splitting this array into two arrays based on even/odd indexes? Example: NSMutableArray *oddArray = ([1], [3], [5]); NSMutableArray *evenArray = ([0], [2], [4]); Thanks in advance! 回答1: There are following ways you can achieve that:- The first and second one solution are already mentioned by the above two. Below are the

How to pass variable from UIViewController to delegate UITableViewController

一个人想着一个人 提交于 2019-12-11 03:33:29
问题 I'm relatively new to iOS programming, so bear with me here. The requirement I'm working with is as follows: Screen 1: User is shown a UITableView loaded with data, specifically City and State. The user taps on a selection and is taken to Screen 2. Screen 2: The user is shown a "detailed" view of the item they selected for editing. The City string ( selectedCity ) is placed in a Text Box for editing An NSArray of States is loaded in a UITableView. The state for the selected City should be

NSMutableArray : unrecognized selector sent to instance

青春壹個敷衍的年華 提交于 2019-12-11 02:53:04
问题 I'm trying to store an array int[9][9] with a NSMutableArray of NSMutableArray where I store my 81 integers from the array : - (void)awakeFromNib { // initialization matrix for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { matrix[i][j] = 0; } } // Creating NSMutableArray instance TGrid = [NSMutableArray arrayWithCapacity:10]; [self saveGrid]; } - (void)saveGrid { NSNumber *aInt; NSMutableArray *Grid = [NSMutableArray arrayWithCapacity:81]; for (int i = 0; i < 9; i++) { for (int j =

-[__NSArrayM objectAtIndex:]: index 4294967295 beyond bounds for empty array with arc4random

大城市里の小女人 提交于 2019-12-11 02:50:02
问题 EDIT: i replaced arc4random() to arc4random_uniform() for fix I'm using test flight to monitor crashes. been fixing bugs, however i encounter this bug, i'm not sure why the index is so big. -[__NSArrayM objectAtIndex:]: index 4294967295 beyond bounds for empty array it is likely that this is where the bug is for (NSUInteger i = 0; i < count; ++i) { // Select a random element between i and end of array to swap with. int nElements = count - i; int n = (arc4random() % nElements) + i; [randomName

I am sending dictionary in json and its have two array and multiple value but i am getting response access denied

元气小坏坏 提交于 2019-12-11 02:29:40
问题 I am sending two array and multiple value throw json but when i send this i am getting success code 200 and its response showing access denied pls any one give me right way to solve it ** -(void)SaveColumnConnection { NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURLURLWithString:@"http://xxxyyyzzzz.php"]]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:oneRowColumn,@"oneRowCols",memberTid,@"table_title_id",totalRowStr,@"totRow",rowandColumn,@

how to deal with NSMutableArray containing CoreData Entry after Entry is deleted from CoreData, showing as “<fault>”

落爺英雄遲暮 提交于 2019-12-11 02:17:42
问题 PersonsArray: NSMutableArray = ( "<null>", "<null>", "<null>", "<MyProject.Person: 0x7ffc5257d850> (entity: Person; id: 0xd000000000040000 <x-coredata://8DD0B78C-C624-4808-9231-1CB419EF8B50/Person/p1> ; data: {\n image = nil;\n name = dustin;\n})", "<null>", "<null>", "<null>", "<null>", "<null>") if the user deletes CoreData Entry (entity: Person; name = dustin) PersonsArray: NSMutableArray = ( "<null>", "<null>", "<null>", "<MyProject.Person: 0x7ffc5257d850> (entity: Person; id:

Replace, move objects in NSMutableArray

别说谁变了你拦得住时间么 提交于 2019-12-11 01:22:11
问题 I Have an array which I have already set the capacity to 5. What I want to do is, when I add an object and the capacity exceeds 5 then it moves the whole array structure of objects by one. For example 1,2,3,4,5 (array). Then when 6 comes to be added It must replace 5 and delete one to result in 2,3,4,5,6 and so on.. So in other words it has to save only last 5 objects. BUT as in the actual coding it will save objects with coordinates in an array with capacity of 100+ so it has to be quick and

Unable to save NSMutableArray of my class to file (IOS)

两盒软妹~` 提交于 2019-12-11 00:42:19
问题 Can't find out why my code doesn't work. Please help someone. I created my own class, implemented NSCoding protocol. Do not know what i miss or wrong. Here is saving code NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *fileName = [documentsDirectory stringByAppendingPathComponent:@"Currency.plist"]; Item * item = [[Item alloc] init]; item.x = 3; item.y = 5; item.type = (TType)