Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-07-2010, 05:01 PM   #2 (permalink)
seb_bue
Registered Member
 
Join Date: Nov 2009
Posts: 24
Default

Where do you fill the Array with data?

showData = [[NSMutableArray alloc] init] creates a new and empty array.

The code seems to be right for me, if you fill the array between the first and second line.

The error says, that you try to call the method objectAtIndex from a String: [NSCFString objectAtIndex:]

If you copy the whole code, we can have a look at it.




Quote:
Originally Posted by StefanL View Post
Hi,

I am trying to get NSStrings from a NSMutableArray, but my app is crashing...

Here is my Code - the app is crashing on "branch = [....]; but the NSMutableArray is filled with (see test below)...

Code:
showData = [[NSMutableArray alloc]init];
	
	branch =[showData objectAtIndex:0];
	company = [showData objectAtIndex:1];
	name = [showData objectAtIndex:2];
	phone = [showData objectAtIndex:3];
	email = [showData objectAtIndex:4];
	price = [showData objectAtIndex:5];
	notes = [showData objectAtIndex:6];
	
	NSLog(@"The Branch: %@", company);
My NSMutable Array:

New Array: 12, 13, 14, 15, 16, 19, 18

Test: INSERT OR REPLACE INTO PARTNER (branche, company, name, phone, email, price, notes ) VALUES ('12', '13', '14', '15', '16', '19', '18');

Crashlog: New Array: 12, 13, 14, 15, 16, 19, 18
2010-02-07 21:28:00.956 WPlite[9034:207] *** -[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x3b77970
2010-02-07 21:28:00.957 WPlite[9034:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x3b77970'

May you please can point me to the right direction...

Thanks for any advice,

Stefan
seb_bue is offline   Reply With Quote
 

» Advertisements
» Online Users: 272
25 members and 247 guests
ADY, aikhan, AppAnnex, astalavista, chemistry, fkmtc, HemiMG, her-ur, iDifferent, ilmman, leahov, MarkC, marto1914, mer10, nicko, padsoftware, pavanindira, Raffaello, sneaky, sojourner, syver, tathaastu, timle8n1, touchcream, ziocleto
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,219
Posts: 380,710
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:33 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.