objective-c

Resizing NSTokenField after populating with tokens

I am using an NSTokenField as a way for users to enter tags. Everything works fine and it hooks up with CoreData managing the tags both when the user adds or deletes a tag. I recently added logic so that the NSTokenField would resize vertically as the user adds tags and they break to the next line using Andrew Bowman's IFVerticallyExpan...

How do I dismiss a Modal View Controller Form Sheet in Landscape on iPad containing a UITextView?

I have a Modal View Controller presented as a Form Sheet in Landscape on an iPad. When I dismiss the view, the view jumps to a different location, as in this thread: A modal VC with a keyboard on landscape changes location when dismissed: http://stackoverflow.com/questions/2898353/modal-view-controller-with-keyboard-on-landscape-ipad-ch...

Maximum touch event frequency on the various iPhone/iPad devices?

What's the highest rate of touch events possible (e.g. touchesBegan or touchesMoved per second)? Does it vary between different iDevices (iPhone 3G, 3GS 4, iPad, etc) or between iPhone OSes? ...

Do I have alternatives to using NSLog to debug object values?

Is NSLog the best way to debug the value of variables during execution? I find that navigating into the object doesn't show me what I want to see and I find I have to NSLog all over my application. Is there something that I am missing? ...

How do I test if IOS device has telephone capabilities?

I want to offer phone support in my app at the press of a button for iPhone users, and display a phone number for iPad/iPod Touch users. Rather than detecting what device the user has, is there a better way to query the hardware to see if it has telephony capabilities? This would continue to work should iPad 3G one day open up for voic...

iPhone checking for existance of AVCaptureSession Class

I have integrated a library that uses AVCaptureSession to capture a photo from the camera. As is the AVCaptureSession is only available on iOS4 devices, I want to disable this integrated functionality for older devices. I know that it should be done by weak-linking the AVFoundation Framework and checking for function existance. Weak-lin...

UIViewController Memory Management/Issue?

Hi, I have noticed a strange behavior when adding and removing UIViewControllers I dont post for now any example,I have some view controllers that load their view from a xib and others that i create the view manually.(Do i have to declare Outlets for every element created in IB?even those that are static graphics?or does deallotion happe...

Speed up loading of images

Currently I am retrieving a bunch of images from the internet and scaling them and then displaying them on my view. The problem is I am doing it in the viewDidLoad method - so when the user taps they have to actually wait for this processing to happen and then the view is shown which causes a slight delay. Is there anyway I could show ...

Properties and instance variable declaration

Hi. I notice that you can double declare a variable in this way: @interface A { NSString *instanceVariable; } @propertie (nonatomic, retain) NSString *instanceVariable; @end This has the same effect that just do: @interface A { } @propertie (nonatomic, retain) NSString *instanceVariable; @end Way the compiler don't complain in...

Can't remove object from NSMutableArray

Hi guys, i am trying to remove objects from my NSMutableArray but i keep getting bad_access error. I used "removeAllObjects" and "removeObjectAtIndex" but none of these work. If i add objects to this array , everything is fine. What i want to do is to clear my array before filling it again. I didnt release the array before trying to...

How do I reset a NSLevelIndicatorCell to 0?

I have a NSLevelIndicatorCell embedded as a column in a TableView using Core Data / Bindings. This works fine, but I'm looking for a way to "reset" the LevelIndicator to 0 (no stars selected.) This would preferably happen when the user double clicks on the level indicator or clicks on the single selected star when its selected (ie, to ...

Custom TableView Cell Indentation Issue

Hi, I created a custom UITableViewCell in my app and the default indent when the Delete button is present is not happening, below is a screenshot of my settings. Anyone have any idea as to what I'm doing wrong? Also, here's a shot of the IB properties: ...

Detect changes in NSArray in ObjC

Hello, I need to detect change in NSArray object - that is if some object was added/removed to/from NSArray or was just edited in-place. Are there some integrated NSArray hash functions for this task - or I need to write my own hashing function for NSArray ? Maybe someone has different solution ? Any ideas ? Thanks. ...

For anyone familiar with the "TableViewSuite" sample code in apple dev center.

In the "sample code" in iOS Dev Center there is a TableViewSuite. In the first example SimpleTableView the simulator provides a list of time zones by country. I can not find the list they are pulling from! it appears to be an array but I can't find the actual words that are coming up on the simulator screen in Xcode. I've learned about p...

How to add CIFilter to CALayer

Hi Friends I am new to core animation , i add some layers to my view and add image to it. Now i want to give blur effect to my layer But i don't know how to make CIFilter and add it. I go through the related questions Question 1 Question2 My code is given below (Shows compilation error) #import < UIKit/UIKit.h > #import < Quartz...

Converting images on the ipad, or server side

I'm working on an ipad application that needs to work with images; it uses four different versions of each image in different situations (each has its own resolution and image quality). The options I have to get the images in the app are: 1) Download only the original image. Convert the image into several formats on the ipad. CPU/mem c...

Monitoring Apples "System Events" with Cocoa

Hey all, I was wondering if there was a way to write a Cocoa app that listened for OS system events such as an application launching, a window switches, etc, etc. My thought was to watch [NSNotficationCenter default] for messages but so far I haven't been able to find much. Does anyone have any suggestions? Thanks! ...

How to append a UIImage or CGImage to an AVAssetWriter?

Is it possible to convert a UIImage instance to a CMSampleBufferRef so that it can be appended to a specified output file using AVAssetWriter's appendSampleBuffer: method? If so ... how? Thanks ...

Swipe to change UIViewContent

Hej folks, I got an UIView in my application and want to implement kind of a swipe gesture. I know how I detect this gesture (touchesBegan: and touchesEnded: for example is x coordinates are distanced more than 100 pixels or something else) but I really don´t now how to animate my needs. In fact my UIView will contain subviews which are...

Unique keys in NSDictionary - how to check given keys are copies?

I have an NSDictionary in which I use my own classes (NSObject subclasses) as keys and would like to make sure that I do not include the same key twice. However, because NSDictionary copies its keys, if I try to check whether an object is in the dictionary, it never thinks it is. For example, MyClass* obj = [[MyClass alloc] init]; NSMut...