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

View Single Post
Old 12-09-2008, 03:49 PM   #6 (permalink)
gavinsan
New Member
 
Join Date: Dec 2008
Posts: 12
gavinsan is on a distinguished road
Default

Quote:
Originally Posted by roberthuttinger View Post
this makes sense to me. in php you can do a rand(0,10) etc to get a random number between 1 and 10 but what is the syntax for xcode? and concatenating strings so if I generate a random number, how can I take that number to get the equivelent of: "image/imgNum" . $i . ".png"?
is there a 'cheat sheet for how to do these basic things?
I have a similar question, how can i call or, create a object name dynamically? Something like this:

Imagine i have this:

for (int i = 0; i < 10; i++) {
[newRecord setNumber'i':@"0"];
}

what is the syntax for this? Or in this case:

for (int i = 0; i < 100; i++) {
[image'i' setAlpha:1];
}

so it can automatically set the alpha to 100 pictuers named image1, image2, image3 etc. ?


thanks =)
gavinsan is offline   Reply With Quote
 

» Advertisements
» Online Users: 382
19 members and 363 guests
13dario13, aaronredmond844, bbbsaha, cserft, DaveDee, guusleijsten, Hamood, Hercule, iShailesh, jacob7khan, Lily.P, loan2ameri, MysticLine, prbiztech, QuantumDoja, roof44, seokwon lee, Vijithasri06, wserver
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,600
Threads: 94,084
Posts: 402,781
Top Poster: BrianSlick (7,990)
Welcome to our newest member, loan2ameri
Powered by vBadvanced CMPS v3.1.0

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