cocoa-touch

NSStringFromPoint disappears under Objective-C++

The function NSStringFromPoint disappears when I compile my code using objective-C++, but it's fine under objective-C. How can I make objective-C++ see that function? If I compile under Objective-C++ it says: error: 'NSStringFromPoint' was not declared in this scope error: 'NSStringFromRect' was not declared in this scope error: 'NSEq...

Problem with reading data from plist iphone sdk

Hi all, I'm creating a myDb.plist file in my resources folder and trying to read it, but it's not getting read. I'm using the following code. NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"myDb" ofType:@"plist"]; contentArray = [NSArray arrayWithContentsOfFile:plistPath]; contentArray is showing null. Can anybo...

UITableView - centering of Sections

Hi all, I am using a table view with its style set as "Grouped". I have only 2 sections to be displayed in the table view and the table view does not occupy full iPhone screen (It has some other views with it). So I would like to display those 2 sections centered in the table view rather than displaying the sections from the top of tabl...

How can I draw a shadow beyond a UIView's bounds?

I'm using the method described at http://stackoverflow.com/questions/805872/how-do-i-draw-a-shadow-under-a-uiview to draw shadow behind a view's content. The shadow is clipped to the view's bounds, although I disabled "Clip Subviews" in Interface Builder for the view. Is it possible to draw a shadow around a view and not only in a view? ...

UITableView Animation when entering Editmode

Hi! Maybe I´m just stupid but I cant understand why this isnt working. I want to achieve a little animation when I'm entering editing mode within a UITableView. [super setEditing:NO animated:YES]; [myTable setEditing:NO animated:YES]; [myTable reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Edit"]; [self.navi...

App not installed...because its resources have been modified

One user cannot install my app because they continue to receive the error: The application “myapp” was not installed on the iPhone “myPhone” because its resources have been modified I've read the error occurs because of adding files after the app is built. I have not added any files. Last week, the user could install the ad hoc with...

Deallocated object getting UIGestureRecognizer message

I have a view that on receiving double tap, sends a notification to the root controller, who in turns removes and releases the view. The problem is that after the view has been released, it receives another delayed GestureRecognizer event. Following is the info from 'Instruments': Category Event Type RefCt Timestamp Addres...

how to manage multiple asynchronous NSURLConnection delegates?

I have a class that makes multiple asynchronous connections where each connection performs its own logic in the delegate methods. Because the delegate is the class itself, how can I implement this separation in logic in the NSURLConnection delegate methods? ...

Having the UIControlEventValueChanged fire when UISlider is being animated?

Hi :) I have set my UISlider up to respond to value changed events: [customSlider addTarget:self action:@selector(sliderMove:) forControlEvents:UIControlEventValueChanged]; [customSlider addTarget:self action:@selector(sliderStart:) forControlEvents:UIControlEventTouchDown]; [customSlider addTarget:self action:@selector(sli...

Cocos2D, UIScrollView, and initial placement of a scene

Hello: I am using a UIScrollView to forward touches to Cocos2D as outlined in http://getsetgames.com/2009/08/21/cocos2d-and-uiscrollview/ Everything works great after a few days of working with it, except one thing: when the initial view appears on the screen, the background appears to be scrolled to the center. As soon as I try to s...

As-You-Type-Searching with Core Data / NSFetchedResultsController

I implemented an as-you-type-searching (text search on single attribute) by fetching with performFetch: after each given character by the user. The performFetch: is running in a background thread to avoid keyboard freezes. But while typing many useless fetches are started. A NSOperationQueue might be an option, but I wonder if there are...

Objective C Naming Convention for an object that owns itself

With the latest releases of XCode that contain static analyzers, some of my objects are throwing getting analyzer issues reported. Specifically, I have an object that owns itself and is responsible for releasing itself, but should also be returned to the caller and possibly retained there manually. If I have a method like + (Foo) newFo...

Why isn't my javascript working on a local HTML file using UIWebView loadRequest:?

Hi Everyone, I have a script that generates a temporary HTML file that has links to external Javascript files that it requires to run. <script src="file:///Users/raphaeldefranco/Library/Application Support/iPhone Simulator/User/Applications/BA9E724E-76BD-4F28-B224-54B4C73786D6/LogTen.app/Reports/Time by Year/../../Tools/PlotKit/Base.js...

Looking for marg_setValue fix in iPhoneOS

I am trying to compile a library originally written for Cocoa. Things are good until it looks for the function marg_setValue(). It says there is a syntax error before char in marg_setValue(argumentList,argumentOffset,char,(char)lua_toboolean(state,luaArgument)); (it's talking about the third argument, not (char) ) I am trying to port...

How to unset delegate on UIView setAnimationDelegate: call?

I am receiving crash reports that appear to be from a UIView animation calling a delegate that has been dealloced. Thread 0 Crashed: 0 libobjc.A.dylib 0x334776f6 objc_msgSend + 18 1 UIKit 0x31c566c4 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] 2 UIKit ...

UIViewController memory management

Hi I have a very basic issue of memory management with my UIViewController (or any other object that I create); The problem is that in Instruments my Object allocation graph is always rising even though I am calling release on then assigning them nil. I have 2 UIViewController sub-classes each initializing with a NIB; I add the first Vi...

How do I catch global exceptions?

Is there a way to catch global "crashing" app exceptions like objc_exception_throw, EXC_ARITHMETIC etc. in code? I need that because I want to do some things before the app gets killed by the system. ...

How to enforce horizontal scrolling on UITextView?

I have a UITextView and I would like to only allow it to be scrollable horizontally only. Basically when the UITextView word-wraps I want the user to have to scroll horizontally to be able to view the rest of the contents. ...

Why does addSubview load the view asynchronously

I have a UIView that I want to load when the user clicks a button. There happens to be some data processing that happens as well after I call addSubview that involves parsing an XML file retrieved from the web. The problem is the view doesn't show up until after the data processing even if addSuview is called first. I think I'm missing s...

Core Data: fetch an NSManagedObject by its properties

Hi guys, I have an object NetworkMember that has no attributes but is defined by its relationships Person, Network, Level and Role. In my app, I've found all the four relationships, but I want to make sure not to double-register my NetworkMember, thus I'd like to search for this NSManagedObject before instantiating it. How should I wri...