objective-c

iPhone - Detect the end of the animation

Hi everyone, How can I detect the end of the animation of a modal view (when I do a dismiss)? (I'm talking about MFMailComposeViewController which is not created by myself...) Thanks ...

Getting content-type for a file in ObjectiveC

Hi All, How to get the Content-Type for any file in ObjectiveC ? I can then set the "Content-Type" header while sending the file to any web server. Thanks ...

How to handle "mutating method sent to immutable object" exception?

I am having a class called Customer. Customer *object; //in this object i have the following data varialbles. object.customerName object.customerAddress object.customerContactList I declared customerContactList as NSMutableArray and also allocated and initialized. Now I am adding or deleting from contactList. //Adding. [object.cus...

Static lib 3.1.3 + App 3.2/4.0b2: initWithNibName:bundle: corrupting ivar

I have a static library built with 3.1.3. I'm including it into an application, which I'm building with 3.2/4.0b2. The static library contains a UIViewController subclass, which in it's -init calls [super initWithNibName:nil bundle:nil]. This method in turn calls _doCommonSetup, which corrupts one of the subclass's ivars: 0x003a68e9 ...

objective-c having issues with an NSDictioary object

I have a simple iPhone app that Im learning and I want to have an instance variable called urlLists which is an NSDictionary I have declared it like so: @interface MyViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>{ IBOutlet UIPickerView *pickerView; NSMutableArray *categories; NSDictionary *...

unclear use of @property in window app using core data

Looking through a Window based application ive used to experiment with as a way of getting my head around core data, ive noticed that the appdelegate has the following code myAppDelegate.h #import <UIKit/UIKit.h> #import <CoreData/CoreData.h> @interface myAppDelegate : NSObject <UIApplicationDelegate> { NSManagedObjectModel *managed...

Should I merge .pbxproj files with git using merge=union?

I'm wondering whether the merge=union option in .gitattributes makes sense for .pbxproj files. The manpage states for this option: Run 3-way file level merge for text files, but take lines from both versions, instead of leaving conflict markers. This tends to leave the added lines in the resulting file in random order and the user shoul...

NSMutableArray with only a particular type of objects

Hello, is it possible to specify that a NSMutableArray can only contain a certain type of objects. For example, if I want to store only this kind of objects : @interface MyObject : NSObject { UInt8 value; } In order to be able to use the instance variable like this : - (void)myMethod:(NSMutableArray *)myArray{ for (id myObje...

Why are controls (null) in awakeFromNib?

This is a follow on from another question regarding why I could not set UIControls in awakeFromNib. The answer to that is that as you can see below the controls are nil in the awakeFromNib, although they are initialised to the correct objects by the time we get to viewDidLoad. I setup the view the same as I always do, should I be doing s...

How to create a Password protected pdf file in iphone sdk

Hi all, Is any one have an idea to how to implement a password protected file in iphone sdk. I mean to I need to create a password pdf file from my application.Please help me. Any one's help will be much appreciated. Thankyou, Sekhar. ...

UILabel text doesn't word wrap

Hi, I have a long text string (including \n newline charactersthat I feed into a UILabel for display. The UILabel is dynamically setup to provide sufficient space foor the text. My code looks like this: myText = [NSString stringWithFormat:@"%@some text: %@ \n \n %@", myText, moreText1, moreText2]; NSLog(@"%@", myText); myLabelSize = [v...

iPhone - Strike out text for firmware 3.0

Hi everyone, I would like to strike out some text of a UITableView on the iphone firmware 3.0. I posted this one: http://stackoverflow.com/questions/2708732/iphone-strike-out-an-nsstring but didn't get an answer for firmware < 3.2. Thanks ...

Why is my app running

I have compiled my iPhone app with setting (Device, Release). I install it on the test machine and it runs with no problem. Here's the problem. The app is linked to a C++ library. The compilation on the simulator has no errors. However the device compilation produces 568 errors, mostly about different visibilities w.r.t AppDelegate.o. ...

How to decode base64-encoded <data> (CFData/NSData) property in a property list?

I am trying to reverse-engineer a preferences file (not for any nefarious purposes, just so that I can script usage of it) that, among other things, has arrays of coordinates stored within it. This is the salient snippet from the property list: <dict> <key>$class</key> <dict> <key>CF$UID</key> <integer>34</integer> </dict...

Showing .dmg EULA when updating with Sparkle Framework

I always have an EULA attached to my DMGs. But my users now can only see it the first time they download my application. Whenever they get an upgrade within the app through Sparkle framework, the EULA is not shown when the .dmg gets extracted by Sparkle. How can I make Sparkle show the EULA? ...

Properly declare delegation in Objective C (iPhone)

Ok, This has been explained a few times (I got most of the way there using this post on SO), but I am missing something. I am able to compile cleanly, and able to set the delegate as well as call methods from the delegate, but I'm getting a warning on build: No definition of protocol 'DetailViewControllerDelegate' is found I have a De...

How to share information across controllers?

Hi everybody, I recently started programming my first Cocoa app. I have ran into a problem i hope you can help me with. I have a MainController who controls the user browsing his computer and sets some textfield = the chosen folder. I need to retrieve that chosen folder in my AnalyzeController in order to do some work. How do i pass t...

Watching a YouTube clip with a UIWebView Causes Weird Results : No UIView Animations, Sound Stopped Working

Essentially, I'd like to embed a mobile website inside of my app which contains a list of YouTube clips. I've added a UIWebView to my ViewController, loaded up the site properly : - (void) setUrl:(NSURL*) newUrl { [newUrl retain]; [url release]; url = [newUrl retain]; [newUrl release]; NSURLRequest* requestObj = [NSURLRequest requestW...

Does anyone know of a Cocoa/Obj-C library that can be used to gather application usage data

I would like to be able to gather info like how often certain windows are opened, what types of user data are accessed, how often menu items are clicked, etc. Does anyone know of a 3rd party (open source or commercial) Cocoa/Obj-C library or plugin that would allow me to gather this info? ...

How can I set a breakpoint on _NSLockError()

I am trying to debug multiple threads. *** -[NSLock lock]: deadlock (<NSLock: 0xc388ab0> '(null)') *** Break on _NSLockError() to debug. How can I debug this? ...