objective-c

How to dynamically subclass a class and instantate the subclass in Objective C?

I want to dynamically subclass a class (say NSString) and instantiate that subclass for testing purposes. How can I do that in Objective C? ...

Is it bad practice to use unicode symbols or shapes in a  app?

There have been a few times where I've used unicode symbols in place of small icons in one of my Cocoa apps, either because it's easier to draw inline with text or because I didn't feel like firing up Photoshop to draw a simple arrow. I've wondered though, could there be issues with localization or fonts I might not be aware of? Are ther...

Where can I obtain a complete listing of all NS-based classes (Cocoa)?

Where can I obtain a complete listing of all NS-based classes? ...

warning: declaration does not declare anything

I'm getting this warning all over the place in some perfectly well functioning objective-c code within XCode. My google-fu has failed me... others have run into this but I could not find an explanation on what exactly is causing it or how it can be fixed. ...

Error in device but not in simulator

Hi, I have this line of code (splits is an instance variable): splits = [[NSMutableArray alloc] initWithObjects:[NSMutableArray array]]; This code is obviously wrong (it should be nil-terminated), however it runs fine in the simulator, even though it throws an EXC_BAD_ACCESS on the device. My question is why does the simulator not th...

blinks on the screen at the time of execution.

Here is my code, egg[0] = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Big_egg.png"]]; egg[0].transform = CGAffineTransformMakeScale(0.0, 0.0); egg[0].alpha = 1; [self addSubview:egg[0]]; I want to rotate the egg and simultaneously the size of egg is increasing, my code for this is, [ UIView beginAnimations:nil context:nil...

iPhone's UITextView - how do you know when a text you append is out of view

I have a UITextView that I am appending texts to from time to time, but I am unable to find an API that tells me whether the text I am appending is out of view or not so I can send a scrollToRange message to UITextView. Is there a way to do this? ...

Comparing Strings in Cocoa

I have tried: - (NSString*) generateString { NSString* stringToReturn = @"thisString"; return stringToReturn; } - (void) otherMethod { NSString *returnedString = [self generateString]; if (returnedString == @"thisString") { // Do this } else if (returnedString == @"thatString") { // Do that } } Which never...

On releasing object belong to another object - xcode memory management

Is [[MyObject itemProperty] release] acceptable? Currently, I have MyObject fetching some data and sets it to itemProperty. The delegate of MyObject then fires off and uses MyObject's itemProperty data and releases it. Is this an acceptable way of memory management? I've been told from various books that you should only release an obje...

xml parsing in Objective c

NSString * myxml=@" 2 006Cbm5ubm53bm53bndub 6 00BCbndub8 7 "; how can parse this string in Objecive c.. pls help me .. thanks and regars.. raju ...

UIAlertView

Hi I am using multiple UIAlertViews in my code as follows -(void) myfunc { myAlertView1 = [[UIAlertView alloc] initWithTitle:@"Message" message:[list objectAtIndex:1] delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [myAlertView1 show]; [myAlertView1 release], myAlertView1 = nil; { do something ...

Efficiently Access numerous Cocoa Controls

I have an interface that has large numbers of controls, see image below. What is the best way to access these, creating 288 IBOutlets in my AppController class and linking them all up seems inefficient. I looked at forms, but they seemed to simplistic. This is a proof-of-concept and will not ship so I'm open to any ideas. One caveat...

How to base64 encode on the iPhone

I have found a few examples that looked promising, but could never get any of them to work on the phone. ...

accessing plists on iphone simulator

So I have started building plist files using NSCoder, but as I"m developing i want to look at them and see what data is being saved. How do i find/access the plist files generated by my app in the simulator (and on the device when i get to that) Places Ive looked: application bundle build directory ...

how to show a two or more buttons in UITableViewsFooter Section?

hello i am creating a aplication in i have a home screen.on that home screen i have button titled continue. now i want to load a new view with that button's click.i had successfully done this. on that new view i have a UITable,a navigation bar,now i want 2 or 3 buttons beneath the table View. i do not to create custom cell. i want to don...

Addressing and pointers in objective C

So here is the problem. I have a method (or message as they are called in obj-C) I am passing in a pointer to an object. inside that method i am going to change what that pointer is pointing to, and release the old object. And i would like the instance variable (which is being passed into the method) to now reference the new value assi...

how to get input from UIAlertView?

I want take player name as input by using UIAlertView. Is it possible to add textField on the UIAlertView? ...

Changing the background color of a UIAlertView?

I want to change the background color of my UIAlertView, but this doesn't appear to have a color attribute. ...

What can I do if two methods call each other and I don't want to make one of them public in the header file?

I have two methods -a and -b. -a calls sometimes -b, and -b sometimes calls -a. Both methods are intended to be private, and not called from outside. But I had to make one of them public in the .h file, because otherwise the compiler would go crazy and give a warning for either one of them. Is there any valid and good-practise solutio...

Can an iPhone app block phone calls?

Is it possible to write an application that will block incoming and outcoming phone calls? Or is the iPhone locked down too much? Thanks! ...