objective-c

iPhone: UITabBar custom image doesn't work

Hello All, I use the following UITTabBar and UINavigationBar built-in code to place my own custom image on the background of Tabbar and Navigation bar. It works great in my iPhone 3.0 application. Now, i am trying to convert my iPhone 3.0 application to iOS4.0. I ran the same project in Xcode 3.2.3(for iOS 4.0) now but unable to view my...

How to autorelease CGColorRef

Hi all, I have a method that returns CGColorRef instance created by CGColorCreate method. I need to autorelease the color return from this method. Does anyone know how to do this? //red,green,blue are from 0-255 range +(CGColorRef) getColorFromRed:(int)red Green:(int)green Blue:(int)blue Alpha:(int)alpha { CGFloat r = (CGFloat) re...

UIScrollView doesn't remember the position

Has anyone ever had the problem that a UIScrollView, which gets moved by [UIScrollView setContentOffset:...] doesn't "remember" it's new position? It however does, if the user scrolls via touch-and-drag. Symptoms: If the UIScrollView doesn't remember the new position, it "flips" back to the original position it last remembers (which is ...

iPhone Video compression on/off

Hello, I have implemented video capturing by: IImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; NSArray *sourceTypes = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType]; if ([sourceTypes containsObject:(NS...

AVaudioplayer interruptions does not automatically continue with the playback

Hi to all, i have tried the coding for interruption handling when i get a phone call on my iphone. - (void) audioPlayerBeginInterruption: (AVAudioPlayer *) player { if (playing) { playing = NO; interruptedOnPlayback = YES; [self updateUserInterface]; } } - (void) audioPlayerEndInterrupti...

how to use windowScriptObject on the iPhone?

Greetings! I was wondering how I could use javascript code on an iPhone application I was developing. this tutorial illustrated how to use windowScriptObjects for Cocoa application. However, I have been unable to locate something similar for UIWebViews. does this functionality actually exist in Cocoa touch? and if yes, could anyone poi...

Can I see which objects are referencing a particular object?

I have a problem with objects not being deallocated. It would be of great help if I could find out what objects are still referencing the object that should be deallocated. How can I get such information? ...

animated button for my iphone app

Hello all, i am developing app for my iphone most of her was completed. now i want to add another button but i want it to be spaciel button. the shap of the button will be like radar screen and when i press it i want from the button to spin around. can someone help me with guidlines. thanks ...

Releasing reference to UIApplication's delegate results in EXC BAD ACCESS, why?

Hello I am running my application through xcode's static analyzer and it pointed out that I had a potential leak in a file: MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; So after the code I do [delegate release]. This results in an EXC BAD ACCESS when the view controller I am doing this in ...

OS X time until (system/display/disk) sleep?

Does anyone know of a way to query OS X in order to find out how much time is actually left before it enters either system sleep or activates the display sleep (or even disk sleep), either via the command line, or any other method (Ruby or Objective-C for instance)? I thought something like pmset via the command line might have offered ...

How to redraw a view? (OpenGl)

Hi, I want to create a kind of a simulation. It should display the certain position of a fish/shark/orca (not real ones, they are set up randomly). My Simulation can display the starting situation: glOrtho(0, breite, 0, hoehe, 0, 1); glClearColor(0, 0, 1, 0); glClear(GL_COLOR_BUFFER_BIT); //Besetzen der Felder srand(time(0)); NSMutable...

NSPanel : double animation

Hello, I am trying to animate an NSPanel derived window with a fade-in while sliding (moving from outside to inside the screen) What is way to do a such animation? Thanks in advance for your help, Regards, ...

Accessing Dropbox in your iPhone App.

Are there any Tutorials or Code Snippets available detailing how to access a users Dropbox so you can display the Data? ...

[Iphone] Is it possible to subclass UiApplicationDelegate protocol?

To be honest I don't know how to call it, so I'll try to describe it. UIApplicationDelegate protocol has "application:handleOpenURL:" method. And if I implement this method in my ApplicationDelegate class, it will be called when somebody opens my urls. details: http://developer.apple.com/iphone/library/documentation/uikit/reference/UIA...

Memory Leak Issue caught in Instrument tool via XCode.

I have one class which is implemented this way .cpp MyClass::~MyClass() { if(m_List) { delete m_List; m_List = NULL; } } MyClass* MyClass::Create() { MyClass* self = new MyClass(); // leak here as per Instrument if(!self) { return NULL; } if(!self->Construct()) { del...

How to set scope in UISearchBar

I have a UISearchBar which is working fine, but I was wondering how I can set a scope and filter results based on certain criteria like: "Dogs and "Cats" Tutorials and example code welcome. ...

removeFromSuperview and memory management

Hi guys, I'm new to objective-c and at the moment developing a small application. I have some memory management issues and want to ask this particular question. I have a button, appearance of which I'm changing: for (UIView *subview in button.subviews) { if (![subview isKindOfClass:[UIImageView class]]) // don't remove UIImageView, ot...

iPhone: Move UIImageView continuously with swipe.

I want to move an image (cBlock) continuously with a gesture. The direction of the swipe gesture determines the direction of the movement. I am able to move, but not continuously. Although the finger is held down, the movement starts/stops. Can anyone see why? I believe touchesMoved is called continuously, as the log statements appear ...

NSDictionary Filtering and Sorting

Hi, I am working on a App that makes use of a JSON API and I am Using the JSON for Objective C Framework to get the Data into a NSDictionary. The dictionary loos like this: ({ admitted = "<null>"; agreed = "<null>"; "area_id" = 1; "area_name" = "Digitales, Urheber-/Patentrecht, Datenschutz"; created = "2010-08-17 12...

Is there a diff in the new iphone versus previous version (development perspective) ?

If I get an iphone, should I go for the latest version (with the antenna issue) or can I make do just fine with the previous version? i.e. are there significant O/S changes that will effect my ability to test and run an iphone application? ...