objective-c

Objective-c: Finding index an object exists at.

[arrayName containsObject:myObject] Is there any way to find the index where myObject exists in arrayName? ...

Best way to save to nsuserdefaults for custom class?

If I have a custom class Person which has three variables (which are propertized and synthesized): NSString* theName; float* theHeight; int theAge; Person instances are stored in an NSArray 'Group'. There is only one Group. What is the best way of storing and loading the Group in NSUserDefaults? (bearing in mind that float and int are...

What are private APIs

What does Apple mean when they refer to private APIs? ...

Can I used [NSObject hash] to store NSView's in a dictionary?

I've read that -hash does not return the same value on different architectures. However, I don't currently see this in the docs. Is there a better way to store NSView's in a dictionary without subclassing? ...

iphone selecting a row to change view

I have created the view Controllers and attached those to control their respective views. I can't figure out how to make the following code to go the right views though. (This is in the root view controller:) - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { RunViewController *runViewC...

SecureText in UITableViewCell (Textlabel)

How can I set the label of my UITableViewCell to "SecureText"? [cell.textLabel setText:@"passwordNotShown"]; ...

Setting center y position of a CALayer

I am using CATransform3DTranslate to create a carousel with some UIViews on the iphone by translating their layers. The problem I am having is that while z and x appear to be centered the y position appears to be registered at the top. When I translate the y position it is effected by a "camera" distorting them. Does anyone know what ...

Get string value of class propery names in Objective-C

I have the following class definition. Contact.h #import <CoreData/CoreData.h> @interface Contact : NSManagedObject { } @property (nonatomic, retain) NSString * City; @property (nonatomic, retain) NSDate * LastUpdated; @property (nonatomic, retain) NSString * Country; @property (nonatomic, retain) NSString * Email; @property (non...

Disable UITableView Scrolling during editing

Hi I've a UITableView configured to NO scrolling. In standard state (not in editing mode) the scrolling is correctly disabled but when i go in editing mode and I think to move row the scrolling is enabled and this cause some problem. Why, if the scrollingEnabled property is set to NO the scrolling is enabled in editing mode? can anyone ...

How do I generate thumbnails of time increments in a video streaming from a URL for the iPhone?

I am able to stream a video from a URL, but I can't quite figure out how to generate thumbnail images of this streaming video at a certain time increment and allow the viewer to skip ahead by touching the thumbnails. I would also need to be able to display the thumbnails when the screen is touched during the video. Any help would be gr...

callbacks via objective-c selectors

I have a "BSjax" class that I wrote that lets me make async calls to our server to get json result sets, etc using the ASIHTTPRequest class. I set it up so that the BSjax class parses my server's json response, then passes control back to the calling view controller via this call: [[self delegate] performSelectorOnMainThread:@selector(...

OBJ-C - Getting a class name from a class hierarchy

Let's say I have the following headers: @interface SuperClass : NSObject @interface SubClass : SuperClass I'm alloc'ing an instance of the class by doing: SubClass *sc = [[SubClass alloc] init]; In my SuperClass.m: - (id) init { self = [super init]; if (self != nil) { NSString *cString = NSStringFromClass([self class]); ...

iphone opaque background logo?

How would I go about adding an opaque logo to the background of a simple scrollview with text on it? I want the logo to stay still while the text scrolls. ...

Objective-C stringWithFormat misses an argument?

When I run this code: - (NSString *)description{ return [NSString stringWithFormat:@"(FROG idle:%i animating:%i rect:%@ position:%@ tongue:%@)", self.idleTime, self.animating, NSStringFromCGRect(self.rect), ...

iPHone splitting the UIPIcker question

How do I split the UIPicker into multiple parts, like the date picker only not the Day, month, and year - my own specified variables such as - Gender and age? ...

iPhone adding a timer to an app

How would I go about adding a simple 2 minute timer to my app in almost the exact same way that the clock app does? I just want the user to click start and have the timer start displaying the timer counting down from 2:00 and beep when it hits 0:00. ...

Adding More Than 2 Delegates in iPhone App

This is a simple question that can be answered fast by someone who's more familiar with Objective-C than I am- how can one add more than 2 delegates to a Class? To clarify, I'm used to putting delegates in classes like this: @interface ViewController : UIViewController <UIWebViewDelegate> { ... When I try to put two delegates: @inter...

Weak linking on iPhone refuses to work

I've got an iPhone app that's mainly targetting 3.0, but which takes advantage of newer APIs when they're available. Code goes something like this: if (UIApplicationDidEnterBackgroundNotification != NULL) [nc addObserver: self selector: @selector(irrelevantCallbackName:) name: UIApplicationDidEnterBackgroundNotification object: nil]...

Uploadin Image - Objective C

Hi, i have this code the i find on youtube xD my cuestion is , how do i add an extra parameter NSData *imageData = UIImageJPEGRepresentation(imagen.image,0.0); NSString *urlString = @"http://urlexample.com/upload.php"; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithStri...

Referencing different rows in UIPicker

Now that I have my UIPicker split into multiple rows, how do I reference those individual rows when setting their values? ...