Hi, am having the following problem:
In my app I am creating a temporary object, for example a label in the following way:
UILabel *tempLabel = [ [UILabel alloc] initWithFrame: CGRectMake(100, 5, 200, 30)];
tempLabel.backgroundColor = [UIColor colorWithRed: 1.0f green: 1.0f blue: 1.0f alpha: 0.0f];
tempLabel.text = [ [WordsDatabase sha...
I have a (float) rating value as a percentage from 0..100 (where 50 = Just OK, 0 = terrible and 100=best).
What's a simple way to display this as a 5 star rating on the iphone, with the following requirements:
simple (ideally just using drawing operations based on a png of a single star or five of them, and without needing to resort t...
Is there a way to set the starting selected segment in a UISegmentedControl in Interface Builder, or do I have to do it in the code? If it's in the code, is viewDidLoad the best place to set it?
...
Background:
I have a tableview displaying about 8 sections each backed with my own PlaceList class representing a list of objects (the implementation uses an NSMutableArray). There are around 200 objects in total. Each section corresponds to how far away the object is from the current location (e.g. within 1 mile, within 10, 25, 50...et...
what's the difference between a C function (static or not) declared inside or outside the implementation block (@implementation ... @end) of a Objective-C class?
is this specially true?:
If you need to poke inside of the object directly, you can put this function inside of the @implementation block of your class, and then you can ac...
Hey guys, I want to store a categorized list of URLs. This is an internet radio streaming app, and so I want to have at least three links for each genre:
the free streaming URL with commercials
the premium streaming URL at 128 kbps
the premium streaming URL at 256 kbps
So every genre will have these three URLs.
For the premium strea...
Hi,
How can I detect a double tap on a certain cell in UITableView?
i.e. I want to perform one action if the user made a single touch and another if a user made a double touch? I also need to know an index path where the touch was made.
How can I achieve this goal?
Thanks.
...
Hi,
I've got a timer which fires when viewWillAppear method is being called and invalidates when viewDidDisappear method is being called. But after a certain amount of switching between views the timer continues firing even after it was invalidated. What's the problem?
Here is my code:
NSTimer *timer;
- (void)viewWillAppear:(BOOL)ani...
Hi,
what are best pratices to reuse UIViewControllers? In many apps (including Apple's own examples: e.g. SQLiteBooks), UIViewControllers are allocated and initialized everytime, a UIViewController is pushed to the stack. This increases the use of memory with every new controller, because the objects stay in memory and aren't used again...
A lot of apps pop up a transparent view with rounded corners and an activityIndicator when running a time consuming operation.
How is this rounding done and is it possible to do it just using Interface Builder (as there are lots of places I'd like to use something like this)? Or, should I use an imageview with a rounded rect or stretcha...
I have an array of objects that are positioned using CGPoints . At certain times in my app, an object in the array needs to notify other non-arrayed objects of its position. I understand that NSNotification is the best way to go, but I cant find a decent example of a 'sender' and 'reciever' for the notification that wraps and unwraps a C...
Hi guys!
I have a problem and I will try to explain the issue:
I have one main UIViewController (Whole screen)
I have one secondary UIViewController (setbounds)
I added my secondary view to my mainview using this:
[mainController.view addSubview:secondaryController.view];
I created a third controller: modalController, i added it to m...
I am trying to save images using the following code:
- (void)writeData{
if(cacheFileName==nil)
return;
if(cacheDirectoryPath==nil)
return;
if (![[NSFileManager defaultManager] fileExistsAtPath:[self filePath]]) {
NSData *imageData = UIImageJPEGRepresentation(self.image, 0.9);
NSEr...
Hi,
In a certain view I have got different elements and I need the keyboard to stay always on the screen.
In iPhone OS 3.0, when touching text the keyboard gets dismissed sometimes. How can I keep it from dismissing?
What is the best way to do so?
Thanks.
...
I'd like to pass dict to the method processit. But once I access the dictionary, I get EXC__BAD_INSTRUCTION.
NSNotificationCenter *ncObserver = [NSNotificationCenter defaultCenter];
[ncObserver addObserver:self selector:@selector(processit:) name:@"atest"
object:nil];
NSDictionary *dict = [[NSDictionary alloc]
...
I've seen countless infos on how to play a sound file, but how can I generate a specific audio tone (or several) at given Hertz in cocoa touch?
...
Playing with URLs, more specifically building them incrementally from other, discovered URLs. In doing so, I'd like to stay using NSURL objects instead of manipulating NSStrings, just to gain the added sanity checks and url-specific methods from the URL class.
Unfortunately, it seems that there is no way to get the following to join to...
I am trying to animate a piece of text being pasted on to a view as a post-it note. I have a view with a yellow background, which contains a text view and a close button, initially set to be hidden. I animate it onto the main view like this:
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:postitView cache:NO];
p...
I have a tableView that's loosely based on the DetailViewController in ye olde SQLiteBooks. It's created programatically. Each cell displays a single value that when clicked displays a generic editingController that allows the user to edit that value. Pretty standard Cocoa-touch stuff...
Except...I also have a segmented control in the ...
Hello,
I have a quite simple question but the answer is not so easy.
I want to hide a UITabBar when my orientation change.
I looked 2 ways :
Frame way
myAppDelegate.tabBarController.tabBar.frame = CGRectMake(<<bottomOfScreen>>);
Works fine but I have a blank area, so tried to play with tabBarController.view.frame et myViewControlle...