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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-13-2012, 09:39 PM   #1 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 8
chris Good is on a distinguished road
Default declare a NSMutablearray of uiimages globally

I want to declare a global array so I can use this in all methods and every where in my app. I have two buttons which 1 shows the next image in the array and the other button shows the previous image shown. I want both buttons to use the same array

NSMutableArray *images = [[NSMutableArray alloc] initWithObjects:@"Americans.png",@"Approach.png",@ "Arianny.png",@"Atoms.png",@"Australia.png",ni l];
chris Good is offline   Reply With Quote
Old 01-14-2012, 01:42 AM   #2 (permalink)
Registered Member
 
apatsufas's Avatar
 
Join Date: Jan 2011
Location: Thessaloniki, Greece
Posts: 121
apatsufas is on a distinguished road
Default

You can use a singleton class which will hold the array and access the array from an instance of the singleton. Search the forum you'll will find tutorials on how to make and use singleton classes. (I think DuncanC has a very good one which comes with an example)
__________________
SQLed - Your Database Manager on the go

iAZConverter - Converts everything from A to Z
apatsufas is offline   Reply With Quote
Old 01-14-2012, 10:35 PM   #3 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 8
chris Good is on a distinguished road
Default

Quote:
Originally Posted by apatsufas View Post
You can use a singleton class which will hold the array and access the array from an instance of the singleton. Search the forum you'll will find tutorials on how to make and use singleton classes. (I think DuncanC has a very good one which comes with an example)
thanks
chris Good is offline   Reply With Quote
Reply

Bookmarks

Tags
global, iphone, nsmutable array, xcode

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: 385
10 members and 375 guests
7twenty7, Atatator, glenn_sayers, guusleijsten, iphonedevshani, QuantumDoja, sacha1996, Sami Gh, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

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