Suppose I have Objective C interface SomeClass which has a class method called someMethod:
@interface SomeClass : NSObject {
}
+ (id)someMethod;
@end
In some other interface I want to have a helper method that would dynamically invoke someMethod on a class like this:
[someOtherObject invokeSelector:@selector(someMethod) forClass:...
I'm getting really desperate trying to add a UIImageView to UITableViewCell.backgroundView. All my efforts have resulted in this crappy rendering:
It looks like the cell's label's white background is sitting on top of cell's background and covering portions of it.
I tried setting the label's background color to clear, or some other c...
Suppose I have a string "167282". How can I check if the string contains "128"? Is there any provision to know the percentage of the 2nd string that matches the first string? (If all the characters of the 2nd string are present in the first string or not.) Please help and thanx in advance.
...
Hello, I did some experiments on autorotation.
The situation: I have a TabBar 4(tabs), three should be portrait only. The last one is a UINavigationController, which by itself should not autorotate any of the stacked controllers. It is basically a browsing application, as I show file and folders everything should be portrait. Some times,...
I'm referencing two static libraries. I build them in debug-simulator mode and all works well with my app. I then create debug-iphone builds and push my app to the device. It breaks with this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString sizeWithCGFont:pointSize:constrainedTo...
I have a custom UIScrollView which contains UITableView and UITextView. When user clicks on text field, keyboard pops up and it also disappears when user presses Return key on keyboard.
Question: How to get rid of keyboard when user taps on UITableView? No matter what I try, I just can't catch any touch events... Using iPhone 3.0 SDK si...
Does anyone know of any libraries for Objective-C Cocoa Touch that provide data entry fields for all different types of inputs (e.g. Date fields, Boolean, Numbers, Integers, etc). Aside from just the built in text fields that accept all inputs? I know you can limit input in the text field delegate and change the keyboard, but stuff like ...
Hi there, I am trying to do something I am not really sure is possible :)
I have application that is in portrait mode and doesn't react to device rotation. Almost all parts of app work best in portrait so I disabled autorotation.
But one part should be viewed in landscape. I just drawed my view rotated by 90 degrees and with this force...
Hi there,
I'm sorting out some memory issues with my iPhone app and I've just been thinking about some basics. If I setup an ivar and never end up using it in the lifespan of my object, when I call dealloc on it, will that cause a problem? E.g.
@interface testClass {
id myobject;
}
@property (nonatomic, retain) id myobject;
@end
@...
Haven't looked at this in a while, so I could be misremembering, but I thought it was possible to set the clearButtonMode of a UISearchBar without walking the subviews to find the UITextField instance. I'm looking now and not seeing anything, so it's entirely possible that I was hallucinating.
...
Hi All,
I need a clarification in releasing the objects assigned to the protocol type.
I have a protocol name iTaskFinish;
I need to assign a particular object for this protocol to which class I have implemented the
methods.
so I declared as .h as follows
id<iTaskFinish> taskFinish;
@property(nonatomic, retain) id taskFinish;
...
I have almost 20 images in PNG format added to my current project on Xcode (under the proper group, Resources). Unfortunately, library window's Media tab doesnt show some of them. And if I create an UIImageView and set one of these invisible images from code, nothing shows up. I also tried from IB with adding a UIImageView and set its so...
I am adding a UILabel as a titleView to a nav bar. I want the text to look like the title that display in the bar.
What are the offset and color to accomplish that?
...
I trying to do an animation on the iPhone and I hope someone can help me out here as I'm stumped.
I am using CAKeyframeAnimation with CAPath to animate views around.
I have these settings set:
animation.removedOnCompletion = YES;
animation.fillMode = kCAFillModeRemoved;
So that the animation is removed from the layer when the anima...
Hi,
I am trying to increase the volume of my Audio Output using the speakHere example from Apple. The volume is already set to max with :
// set the volume of the queue
XThrowIfError (AudioQueueSetParameter(mQueue, kAudioQueueParam_Volume, 1.0), "set queue volume");
However, the output is directed to the ear-piece speaker, which is...
I'm trying to do something really trivial: A macro that takes an string and prints that to NSLog.
Like this:
#define PRINTTHIS(text) \
NSLog(@"text");
However, when I try to pass a string to this guy I end up getting "text" printed to the console. Aren't all variables replaced on a string-level inside the macro? How to do that ri...
Example: When my method -fooBar gets called, I want it to log in the console which other method of which other class called it.
Right now, I only know how to log the method name of fooBar itself and it's class, with this:
_cmd
[self class]
Is this possible to figure out?
...
I have a ViewController which controls a view that needs a different layout in landscape mode than in portrait mode. I made two .xib files that are semantically identical but have different layouts. I know there is a hack to display a second ViewController modally when in landscape mode, but I'd really rather just re-initialize the vi...
I notice that in the stocks application, the small graph wraps around, eg: when you get to the end of the scroll view and swipe right again, you go back to the beginning. Before I go ahead and code this myself is there an easy way to do this in the SDK? I can't find any properties or methods that would enable that?
I have a paged UIScro...
I've got an app that initially loads in one view controller for a period of time before it's replaced by a UINavigationController (and its corresponding root view controller) in the Window's view. Once the app is being managed by the Navigation Controller I am releasing the previous View Controller and its View. It's difficult for me to...