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 11-13-2008, 12:03 AM   #1 (permalink)
girls? any new species ?
 
sindhutiwari's Avatar
 
Join Date: Nov 2008
Location: INDIA
Posts: 547
sindhutiwari is an unknown quantity at this point
Send a message via MSN to sindhutiwari Send a message via Yahoo to sindhutiwari Send a message via Skype™ to sindhutiwari
Default how to do this dynamically

Hi,
I am having an UIImageView control to which i am assigning a image dynamically now on a button click i want it to get reset i.e remove the image

another one is

i am using a NSMutalbleArray capacity 10 to which i am assigning strings

like [listOfContents addObject:NSLocalizedString(@"c1.png", @"")][listOfContents addObject:NSLocalizedString(@"c2.png", @"")][listOfContents addObject:NSLocalizedString(@"c3.png", @"")][listOfContents addObject:NSLocalizedString(@"c4.png", @"")]

this tells me that index 1 is having c1.png , 2 is c2.png so on..
now after assigning up to 4 i want to remove that 4th element

in simple words i want to set the index 4 value to nil and again when i assign any value it has to be assigned to 4 position

I will be thankful for the help

Thanks and Regards

sindhu tiwari
sindhutiwari is offline   Reply With Quote
Old 11-13-2008, 02:35 AM   #2 (permalink)
Go Dealloc yourself!
 
Join Date: Oct 2008
Location: Central California
Posts: 130
xnakx is on a distinguished road
Default

huh?

sorry man i don't get what you are trying to accomplish.
you only want 4 items in the array at any given time?
xnakx is offline   Reply With Quote
Old 11-13-2008, 03:46 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 370
david_david is on a distinguished road
Default

can't you replace like [array replaceObjectAtIndex:4 withObject:nil];

If you want to always reset the last element then remove object and addObject again
david_david is offline   Reply With Quote
Old 11-13-2008, 05:04 AM   #4 (permalink)
Not that squeamish
 
Join Date: Oct 2008
Posts: 31
Ossifrage is on a distinguished road
Default

UIImageView extends from UIView, so see https://developer.apple.com/iphone/l.../UIView/hidden which should probably do what you want

Meanwhile, for the array, my first thought is to ask what your high level goal is, since this sounds an odd thing to require (hence I have a feeling there might be a better solution).

But, if you really want to, I suggest making a class with an internal NSMutableArray and an addObject method that checks the length of the internal array, and if less than 4, calls addObject on the array, otherwise calls replaceObjectAtIndex:withObject:
Ossifrage is offline   Reply With Quote
Old 11-13-2008, 05:20 AM   #5 (permalink)
girls? any new species ?
 
sindhutiwari's Avatar
 
Join Date: Nov 2008
Location: INDIA
Posts: 547
sindhutiwari is an unknown quantity at this point
Send a message via MSN to sindhutiwari Send a message via Yahoo to sindhutiwari Send a message via Skype™ to sindhutiwari
Default few things clear

hi

Array problem is clear now

for the image

i will give an example I am having five UIImageView in my view

now i have assigned a image to the UIImageview1 on a button click

again when another button lets say reset is clicked the UIImageview1 has to be set to empty , Hiding is a good idea but how to assign a nil image to that control
sindhutiwari is offline   Reply With Quote
Old 11-13-2008, 05:26 AM   #6 (permalink)
Not that squeamish
 
Join Date: Oct 2008
Posts: 31
Ossifrage is on a distinguished road
Default

Define "nil image"? You mean like...as if the UIImageView were hidden...?
Ossifrage is offline   Reply With Quote
Reply

Bookmarks

Tags
strings

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: 374
7 members and 367 guests
apatsufas, Kirkout, lzwasyc, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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