objective-c

Returning an NSArray without Leaking?

I have been struggling with the best pattern for returning an array from a static method. In my static method getList (in the BIUtility Class), I am allocating an NSArray to return. in the return line, I do: return [array autorelease]; Then in the calling method, I am allocating an array like this: NSArray * list = [[[NSArray alloc...

Looking for Objective-C Spreadsheet Control

The company I work for has a Window application that includes integrated word processing and spreadsheet components. We use TextControl and FarPoint for the implementation. We have been developing an OS X counterpart for this application. The word processing functionality is actually pretty easy--the standard multi-line text view make...

iphone have to hit back twice to get out of view

I have numerous buttons that go to different views on my main page and they all work the same way - they go the view and the area for the back button has the text of the title of the main page. Then on one view, it says "Back". When you click "Back" - the view stays the same but the back button text changes to the same as the rest with...

Obj-C: FSEvent Reports the Same Event Upon Each Launch of the App

I setup a FSEvent that runs well but it keeps reporting the same event each time I launch the app. Ex: My FSEvent monitor directory is: Test/ ...and there are three files: test1, test2, test3 However, after I deleted test1 in my FSEvent Directory, it keeps telling me that test1 has been deleted every time I run the program inst...

Obj-C Memory Management Setter Method

I am new to objective-c and ive downloaded the code from here http://apress.com/resource/bookfile/4175 and ran the Chapter 10, 10.01 CarPartsInit xcode project file. One thing i am not clear about is that, does the memory management of a setter method - (void) setEngine: (Engine *) newEngine { [newEngine retain] [engine releas...

iPad rotation bug when using MPMoviePlayerViewController

Issue summary Changing the orientation of an iPad device or simulator while playing a video using MPMoviePlayerViewController results in an inconsistent rotation state upon dismissal of the video player. This is a known bug in iPad SDK 3.2, documented at http://www.openradar.me/8012810 Sample project I have prepared a minimal sample ...

How to rewrite text in an iPhone app

I'm having a problem refreshing text on a timer. I am displaying the current time and refreshing the screen every second. The problem I'm having is the old time doesn't get erased when the new time gets printed. Here is the function that displays the current time. - (void)drawRect:(CGRect)rect { CGPoint location = CGPointMake(10,...

Calling a NSTimer method

Hi I'm new to working with timers on the iPhone and would need some support. I have a method as below that takes the time and update a label in my user interface. I also have an NSTimer that calls that method once a second (I only show hours and minutes). This works just fine, except for the first second the App is live (as I understa...

WebView - User has scrolled

I cannot figure out how to have a WebView in Objective-c detect when a scroll has been made. I have looked at the WebFrameLoadDelegate and found didChangeLocationWithinPageForFrame method, but that did seem to work. ...

NSThread + Using UIkit (UIImage)

Error- Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now Im running a NSThread to download an image and display it, which is all in a method which is ran an other thread. problem im getting is, when i try to set the UII...

Sample code for Navigation Controller in Utility Template?

ANy sample code, xcode project for creating Navigation Controller in Utility Template's flipsideViewController. I can create settings on flipsideViewController using Interface builder. How to create table view on that screen that will switch to other screens and will come back? ...

TableView is not adding more than 2 TableCellView

I have added a TableView using interface builder. Now i am trying to insert TableViewCellView into that TableView. Its just allowing me drop 2 CellView from the Library. As soon as i dropped 3rd CellView, it put it outside the TableView. what i am doing wrong? Following this tutorial http://iphone.galloway.me.uk/iphone-sdktutorials/cus...

TabController from a Tableview

Hi, I have some problems using UITabBarControllers. All the examples that I read use them from the appDelegate. Here is what I want to perform. I have a tableView that displays a list of items. By clicking on a item, I need to push a view that contains a UITabBarController with 2 barItems (and pass a class object that contains the data o...

Objective c select statement

hey guys im trying to do a SELECT Statement from a local SQLDB so my statement is something like select ..etc..etc WHERE Date =%@,theDate theDate is an NSString variable. i NSLoged theDate and it returned 22/06/2010 But it doesnt work so i tried the following select ..etc..etc WHERE DATE ='22/06/2010' And the values came by. any idea ...

iPhone CoreAudio hang when stopping.

I have an iPhone app that is recording audio and then broadcasting it across the network. In response to a "stop" from the far end it queues a notification to stop the recording. Alas when it gets to the AudioQueueStop call the application just hangs (ie Stop never exits). Thanks to the notification all AudioQueue manipulation is happ...

Correct syntax for accessing c-style object array through objective-c messaging??

Please see comment: static void drawAnObject() { Form *form = [[Form alloc] init]; int i; [form randomizeCube]; glColor3f(0.0, 0.0, 0.0); for(i = 0; i < MAX_CUBE; i++) { glutWireCube(form->cube[i]->size); //compiler issues hard warning because form->cube is protected!! } } I would rather ...

"Incompatible types in initialisation" error makes no sense

I have been a Java programmer for years but only iPhone/Obj-c for a few months. Every time I think I'm comfortable with the language something weird happens. Why does the following generate a "Incompatible types in initialisation" compile error? It seems so straight forward. 'double' is a primitive right?!? -(void) testCalling{ doubl...

Is there any method to stop loading the data in sax parser in Iphone sdk?

Hi guy, I had a problem in my app that when I tap the back button when the data is loading from the sax parser im getting an exception that to for sometimes. Can anyone please help me how to stop the parser when data is loading? Anyone's help will be much appreciated. Thank you, Monish. ...

Decrypting data that was AES encrypted with Objective-C with Java

I try to decrypt data that was originally encrypted with Objective-C in Java. There are other questions mentioning this but they are really cluttered and many of them aren't solved yet therefore I will post my own. This is the code that encrypts the data: - (int) encryptWithKey: (NSString *) key { // 'key' should be 32 b...

change uipicker/ uidatetimepicker font , iphone / objective C

Hello, How to change the font size and style of the uipicker view of iphone. can any one suggest? Thanks ...