objective-c

Reload application while is running OR close it good

Hi, in my app I create at the beginning a tab bar controller with 6 view controllers. One of them is to login in the application, then i have a login/logout button (Facebook sdk). I would like to know if is possible to do the next: 1) OR when I click in the logout button (because at this moment I'm logging in) "To close the entire appl...

How does inheriting from NSObject work?

There are a couple of things about Objective-C that are confusing to me: Firstly, in the objective-c guide, it is very clear that each class needs to call the init method of its subclass. It's a little bit unclear about whether or not a class that inherits directly from NSObject needs to call its init method. Is this the case? And if...

Binding IKImageBrowserView's zoom to the size of its parent NSScrollView

I have a vertical NSSplitView containing on one of its sides a NSScrollView with a IKImageBrowserView inside. The IKImageBrowserView shows only one row of thumbnails and only has horizontal scroller (the resizing mask is equal to NSViewWidthSizable). I would like to bind the zoom level of the IKImageBrowserView to the height of any of ...

Persisting items being uploaded via web service to disk

I have a launchd daemon that every so often uploads some data via a web service using NSOperationQueue. I need to be able to persist this data, both so that it can later be re-uploaded in the event of failure, even between sessions (in case of computer shut down, for example). This is not a high load application, it probably receives i...

NSIndexPath incrementing values

I am trying to populate an OutlineView with the contents of a XML file. I'd like to create and manage the values inside a NSIndexPath while cocoa parses the document. NSIndexPath has methods to add and remove indexes, but I need to increment/decrement the values in each index: [0, 0] [0, 1] [0, 2] and so on... how can I do that? ...

Extract first two digits of hex (UInt32 *) and convert to int

I have a bunch of hex values stored as UInt32* 2009-08-25 17:09:25.597 Particle[1211:20b] 68000000 2009-08-25 17:09:25.598 Particle[1211:20b] A9000000 2009-08-25 17:09:25.598 Particle[1211:20b] 99000000 When I convert to int as is, they're insane values when they should be from 0-255, I think. I think I just need to extract the firs...

Obtain updated annotation coordinate (lat/lng) from callout after drag event objective-c

Does anyone know how I can get the latest coordinated of my annotation after I've dragged a map annotation from a callout of the annotation? How can I access that info? Any code samples would be appreciated. Thanks, Zap ...

Unable to access an enumerated datatype from within another class...

Hoping someone can help me with this as I've done some scratching & searching I'm still overlooking something obvious... I've defined a simple enumerated data type: typedef enum { kLow = -1, kMid, kHigh } MyMode; And made an instance variable of this type in my ClassA: @interface ClassA : UIView { MyMode myMode; } @p...

IP Address? - Cocoa

Hi guys, How would I make a GUI program that displays your Ip address with a click of a button? Please, no difficult explanations, I just started Cocoa not long ago. Thanks, Kevin ...

ViewController Transition notifications

Is there a way to track UIViewController transitions? As part of analytics, I would like to measure how long the user spends in each UIViewController without adding the code to all the controllers. ...

When to call self.myObject vs just calling myObject in Objective-C

This little bit of syntax has been a bit of a confusion for me in Objective-C. When should I call self.myObject vs just calling myObject. It seems redundant however they are not interchangeable. Would someone please enlighten me? ...

Tween a value in iPhone objective-C

Is it possible to tween a variable (let's say a float from 0.0 to 2.0 over a period of time) in objective-C? Something like what TweenMax would do in flash. I guess the class methods of UIView don't do that. Is it doable maybe with CoreAnimation? Or would someone have to use NSTimer? Thanks ...

how to edit a PDF in objective-c?

i'm writing an application in objective-c (using cocoa). i have a PDF template, i need to substitute actual values into placeholders in PDF and then save the result into new PDF. how can i do it? which library should i use? ...

how to disable a button dynamically

How to disable a button after entering a particular letter in a textfield? ...

Where to find a description of all the math functions like floorf and others?

math.h is not really a documentation. Is there something else that will describe these functions a but more in detail? ...

Objective-C categories == visitor pattern?

Would you say that Objective-C categories are an implementation of the visitor design pattern? ...

Adjust size of MPMediaPickerController's view ?

In my application I don't use the upper bar that displays Wi-Fi/Date/Time because it's a game. However I need to be able to let my user to pick his music, so I'm using a MPMediaPickerController. The problem is, that when I present my controller, the controller ends up leaving a 10 pixels ( aprox ) bar at the top of the screen, just in th...

iPhone Memory Leaks

If an application produces a lot of memory leaks, are they "just" an in-app problem or are they also in RAM after the termination of the application? So does the iPhone OS release the memory allocated for the sandboxed application? Thank you ...

NSMutableArrays

I have an NSMutableArray as a member variable for a class. In the .h file: @interface bleh { NSMutableArray *list; } @property (readonly, assign) NSMutableArray *list; @end In the .m file: @implementation bleh @synthesize list; -(void)init; { list = [NSMutableArray arrayWithCapacity:30]; } @end Now, I'm not really an objecti...

Objective C NSCFString Leaks with NSMutableArrays

I am cleaning up my code in a phonebook iPhone application and the Leaks tool in Instruments is reporting that I am leaking NSCFString objects. Here is the pattern that I am following: I have a Person class in my application that has nothing more than local NSString members and associated properties for first name, last name, etc. My ...