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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-06-2010, 01:30 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1
CB_Bebop is on a distinguished road
Default Retrieving entries while iterating through MSMutable Array?

Hi Folks

I have an NSMutableArray which is filled with values from a database.
The array name is "labs" and when debugging, labs is filled with the correct values. see "screenshot.png":


I then use: NSEnumerator to step through the array:
Code:
	NSEnumerator *e = [labs objectEnumerator];
	NSString *mailMessage = @"";
	id object;
	while (object = [e nextObject]) {
	// do something with object
		mailMessage = ???;
	}
I can't seem to figure out how to fill mailMessage with the text from one of the fields within labs. eg. labs.DataBase.Name

Could some one please help?

Thanks in advance.
Anton

Last edited by CB_Bebop; 11-06-2010 at 01:58 AM.
CB_Bebop is offline   Reply With Quote
Old 11-06-2010, 09:47 AM   #2 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
smasher will become famous soon enough
Default

The array is full of DataBases, right? So you need to pull one out and get the string from that.

Code:
for(DataBase *data in labs){
     NSString *name = data.Name;
     NSLog(@"name is: %@",name);
}
I'm assuming that .Name is a property of the DataBase class, and not just an instance variable. I can't tell from the screenshot.

See you space cowboy.
__________________

Free Games!
smasher is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 478
15 members and 463 guests
7twenty7, AlanFloyd, AppsBlogger, David-T, iAppDeveloper, imac74, Jaxen66, lovoyl, Music Man, mutantskin, Sami Gh, SLIC, solardrift, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,683
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, unicornleo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:12 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0