objective-c

NSNotification issue: it's posted but just cached by one instance of the same class, why?

hi guys, here i am again: what i want to do is: if i press a button, then post a notification. This notification should be cached by 2 instances of the same class. the problem: the notification is posted, but it is cached just by one instance. some code and explanation i have 1 tab bar controller i have 3 tabs ( 3 different vie...

Is using class_replaceMethod to implement iOS4.x features in a iOS3.x runtime sane?

I want to use some of the iOS 4.x things in iOS 3.x. I know how to implement them, I assume my implementation is slower or might have more bugs then Apple's so I want to use Apple's any time it is available. Is doing something like this sane: @implementation NSDictionary (NSDictionary_4) void compatability_method(Class class, SEL n...

NSString get -characters

I want to get the characters of an NSString. Like this: NSString *data; const char * typein = [[data characters] UTF8String]; But obviously NSString won't respond to -characters. How do I get the characters of NSString? thanks, Elijah ...

C++ Struct in array, help!

Hello - I have an iPhone app that used to use an array of several thousand small objects for its data source. Now, I am trying to make it use C++ Structs, to improve performance. I have written the struct, and put it in "Particle.h": typedef struct{ double changeX; double changeY; double x; double y; }ParticleStruct; The...

QTMovie setRate problems

Hi everyone! I'm working on a program prototype that (at the current stage) just needs to be able to load a movie and adjust the playback speed. I have the UI worked out, I've gotten the playback to work, but I haven't managed to figure out how to adjust the playback speed. I believed that -[QTMovie setRate:(float)] was the way to do t...

Adding a Finder Window in MacOSX Project

Hi, I'm having trouble finding out how to add a Finder Window to my MAC OSX project in XCode. Is this possible or do you have to build one out from scratch? Thanks ...

Mapping IOKit IOReturn error code to String

When I get error 0x10, I want to be able to make sense of that error code. Looking up IOReturn.h and mach/error.h is not particularly convenient. I was lost when I got 0x22 error code. This is really silly question but is there a function like error2String which can map IOReturn error code to String that describes the error ? ...

IPhone App Crashes on Device

I have a simple app (this is my first one) which loads an image from my resources folder, I change my image like this (with the image name changing): myUIImageView.image = [UIImage imageNamed:@"nextImage.jpg"]; It runs really well on the app I can change the image an infinite number of times. But when I run it on my Ipod Touch, it cr...

Rewrite in place - stdout.

Because I'm currently setting up a new server for use, I've been using a lot of command-line programs like curl and wget, and I've noticed that they do something interesting. When run in the Terminal, they print their current progress in place (e.g. 54% will become 55% in place, instead of 55% being printed on the next line - download a ...

How to config xCode Project to deploy iOS app into iDevice to make it use Mac network (network of which running xCode)?

How to config xCode Project to deploy iOS app into iDevice and make deployed-app use Mac network (network of which running xCode)? ...

How do you use event handlers with parameters?

I'm trying to sort out how the events work. In video 4 of the Stanford course on iTunes U, Alan Cannistraro says there are "3 different flavors of action method selector types - (void)actionMethod; - (void)actionMethod:(id)sender; - (void)actionMethod:(id)sender withEvent:(UIEvent *)event;" I thought I'd try them out with a simple addi...

How to use reuseIdentifiers for views in iphone sdk?

Hi Guy's Can we apply the reuseIdentifiers for the UIView,UIImageView or Labels in a view?If so Can any one suggest me how to do this. Anyone's help will be much appreciated. Thanks to all, Monish. ...

How to find and remove unused class files from a project

My XCode project has grown somewhat, and I know that there are class files in there which are no longer being used. Is there an easy way to find all of these and remove them? ...

iphone JSON Parsing.. How can i parse this data.

this is the print screen of nsmutablearray. this 2409,2410,2412 is not fix key. it coming dynamically. { 2409 = ( { AltSelectionPrice = "2.00"; }, { AltSelectionPrice = "3.00"; } ); 2410 = ( { AltSelectionPrice = "7.00"; }, { AltSelect...

can we have dynamic application icon & splash screen for iPhone OS 4.0/3.0 ?

I can make the splash screen dynamic... but wat about the icon ? ...

Iphone dev Navigation controller memory leak when parsing json

Good day folks. Being a .net guy I;m really strugling with this leaking memory issue, please help! On navigation controller I'm parsing some JSON with touch-Json (tried SBJSON to same result) data from Json is displayed to a tableview. So far it's all fine and dandy. On table row click I'm pushing other xib on navigation controllers sta...

Download a PDF file from server

I want to download a PDF file from my server and save it to the documents directory. I am able to do this using NSData but then the file in the documents directory is not a PDF: it's an NSData object. Is there any way to download and save a straight PDF file? ...

Editing one object in an NSMutableArray also changes another object in the NSMutableArray

I had a navigation application that was working normally. In the table view, the last item is called "add item", and if the user pressed it, it would create a new object and pass it to another view where the user could enter the details for that object. When the user returned to the previous screen, the new object would show in the array...

Object name from String in Objective-C

Hi, i want to set the name of an object like UIButton from a string. NSString *string = [[NSString alloc] initWithString:@"someString"]; UIButton *(string) = [[UIButton buttonWithType:UIButtonTypeCustom]retain]; My goal is: UIButton *someString = [[UIButton buttonWithType:UIButtonTypeCustom]retain]; how can i solve this? ...

Hide detail View

I need to hide a detail view that is shown when clicked on a tableviewitem - (IBAction)done:(id)sender { [self.delegate OrderDetailsViewDidFinish:self]; } It is all connected up with in the, xib and .h but the view doesnot close, it is loaded via this code and loads great: //Initialize the detail view controller and display i...