objective-c

Detecting JavaScript errors in a UIWebView

I'm running into a very annoying issue developing javascript for a UIWebView in an iPhone application. If there is an error in the javascript, it silently fails and halts execution of the function it was running. And some errors do not happen in a desktop browser, so all appears fine. I then run it on an iPhone and get a massive failu...

XCode 3.2.4 Project - no "other linker flags" in build settings visible

Hello, I am recently trying to connect my cocos2d game with open feint, but I can't accomplish it as there seem to be some settings missing in my build settings of any project that I create. For example, I have to check "Call c++ Default ctors/Dtors in objective c", but there isn't such an option in my build settings. What's wrong wi...

Making deep copy of UIImage

My class contains an UIImage property which I want to enforce as a 'copy' property by any external clients accessing it. But, when I try to do a copy in my custom setter, I get the runtime error about UIImage not supporting copyWithZone. So what's a good way to ensure that the correct ownership policy is followed? // declared in the int...

Application loses focus hide window

Ive been attempting to hide my applications main window when the application loses focus. Upon testing - (void)applicationDidResignActive:(NSNotification *)aNotification { [window orderOut:self]; _isShown = NO; } however this only seems to work once, after I bring my window back with [window makeKeyAndOrderFront:self]; [window...

I'm getting Failed with exit code 1 error in xcode

This is my first ever attempt at a Objective-c cocoa program, so I have no clue why it is giving me that error. I really don't understand the Build Result page either. myClass.h #import <Cocoa/Cocoa.h> @interface myClass : NSObject { int a; int b; } -(void) setvara:(int)x; -(void) setvarb:(int)y; -(int) add; @end myClass....

Binding to array controller in another nib for inspector window

Binding a popup menu to an array controller with the path selection.type works fine. Binding a popup menu to a document controller with the path currentDocument.arrayController.selection.type works one way only (changes in selection are not propagated to the popup menu). How can one achieve inspector-window-like functionality by bindi...

Get String Between Two Other Strings in ObjC

I am trying to parse a string and get another string in the middle. ie. Hello world this is a string I need to find the string between "world" and "is" (this). I have looked around but haven't been able to figure it out yet, mainly because I am new to Objective C... Anyone have an idea of how to do this, with RegEx or without? ...

Cubic Spline class for Obj C or C?

I need to use natural cubic spline interpolation in an iPhone app. Does anyone know of a class for Obj C or C that resembles this: http://www.ee.ucl.ac.uk/~mflanaga/java/CubicSpline.html "performing an interpolation within a one dimensional array of data points, y = f(x), using a cubic spline." ...

Recommend books for Mac desktop application development

I want to develop desktop applications for Mac, so could you please recommend me whats the best way to learn it like some ebooks or videos.... ...

using TTThumbsViewController with UITabBarController

I am new to iPhone programming and recently I've found out a great framework, Three20. However, I am stuck in making the TTThumbsViewController to come out when a tab bar item is selected. Any idea? ...

why does initializing subclasses require calling the super class's same init function?

I have heard that when you have a subclass, you are supposed to initialize the superclass with the same init function from within the subclass's init. What I mean is that the subclass's init should call [super init] and the subclass's initWithFrame should call [super initWithFrame]. Why is this? Why does calling the super's init from ...

Downloading a Large File - iPhone SDK

Hello everybody, I am using Erica Sadun's method of Asynchronous Downloads (link here for the project file: download), however her method does not work with files that have a big size (50 mb or above). If I try to download a file above 50 mb, it will usually crash due to a memory crash. Is there anyway I can tweak this code so that it w...

Drawing class to allow layer control

Hi, I would like to implement a drawing class with the help of Quartz. I want to be able to save parts of what is drawn on separate layers. I want these layers to be retrievable, so I can delete/hide/show layers on command. Can I save multiple CGLayerRef as a NSMutableArray property of my class and then be able to retrieve them? If yes...

Auto play youtube error ?

- (void)webViewDidFinishLoad:(UIWebView *)YouTubePlayer { UIButton *b = [self findButtonInView:YouTubePlayer]; [b sendActionsForControlEvents:UIControlEventTouchUpInside]; } - (UIButton *)findButtonInView:(UIView *)view { UIButton *button = nil; if ([view isMemberOfClass:[UIButton class]]) { return (UIButton...

Can I use UITabBarController as a simple viewController switcher?

Hi, I'm creating an iPad app based on a UINavigationController (with the bar hidden) so I can push and pop other viewControllers for navigation around the app. However, I am now wanting to add a section in which there are two viewControllers that I want to be able to switch between, so in other words they are side-by-side, rather than h...

How to implement erase/undo in this method

I have successfully implemented touchesMoved and it is drawing line properly now I am facing problem in implementing erase method, please assist me where I am lacking. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { mouseSwiped = YES; UITouch *touch = [touches anyObject]; CGPoint currentPoint = [touch locationInVi...

Unicode Character Corrupting Text

I have a weird situation that has been puzzling me for weeks. My project, Textual, is an IRC client for Mac OS X. It works great except one problem. DCC SEND messages via the DCC protocol do not work properly. For some reason the first section of the IP address sent for which connections will be established is always cut off. For example...

Assigning a selector crashes on iPod touch 2nd generation

Update: problem magically disappeared, see comment I have a function which works fine on an iPhone 3G, iPhone 3Gs and simulator but crashes on an iPod touch 2nd generation. - (id) initWithDelegate:(id) delegate data:(NSData *) data finishSelector:(SEL)finishSelector{ if(self = [super init]){ _delegate = dele...

Programmatically get the number of the incoming call

How can I programmatically get the number of the incoming call from Background application ? ...

Importing an existing Object in Objective C

How does one use an already existing object from another class? e.g. Have a object of Class1 and want to set its variables from Class2. What does one import? Is it just necessary to import the Class1, will this make the object available to the class that imported? In a class e.g. Main Class1 is created and presented - (IBAction) ope...