I'm trying to use a custom compare method (for use with sortedArrayUsingSelector:) and on another website I got that the format is:
-(NSComparisonResult) orderByName:(id)otherobject {
That's all very well and good, except how do I compare the otherObject to anything as there's only one thing passed to the method?
Like how does the NS...
How do I spell a method whose argument can either be an object of a certain type, or nil? You see those all the time in framework classes, but I've just encountered my first instance where it would be useful to create one.
...
Is there a way to animate properties of my own classes, using the property animation facilities provided by Core Animation?
...
I have a timer set up and it gets called when ever the player is in their turn phase. I also have a multiplier that decrements slowly while the player is committing actions.
for some odd reason my mult variable is returning garbage values I initialized it to 1 in the onLoad statement but it still seems to have trouble. each time the Tim...
I put this in X-code:
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"DrinkArray" ofType:@"plist"];
NSMutableArray* tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path];
self.drinks = tmpArray;
[tmpArray release];
// Uncomment the following line to display an Ed...
Hi I have a table view, and when I delete a cell I am removing an item from an NSMutableArray, archiving that array, and removing the cell.
However, when I do this, it is causing the delete button to lag after I click it. Is there any way to fix this?
// Override to support editing the table view.
- (void)tableView:(UITableView *)tabl...
I have an NSTableView that has 2 columns, one for an icon and the other for two lines of text. In the second column, the text column, I have some larger text that is for the name of an item. Then I have a new line and some smaller text that describes the state of the item.
When the name becomes so large that it doesn't fit on one line i...
I need to determine whether a string (sourceString) contains another string (queryString) and if it does, at what offset.
I'm guessing that NSScanner might do the trick but I don't fully understand the documentation.
Let's say sourceString = @"What's the weather in London today?"
If I set queryString to equal @"What's the weather", I...
I have in the .h file :
NSString *dataHML;
NSString *dataHML2;
NSString *dataHML3;
NSString *dataHML4;
NSString *dataHML5;
NSString *dataHML6;
NSString *dataHMLtotal;
in the .m file i merge them with :
NSString *dataHtmlTotal = [NSString stringWithFormat:@"%@%@%@%@%@%@", dataHtml, dataHtml2, dataHtml3, dataHtml4,dataHtml5,dataHtml6]...
I have a grouped UITableView that has 3 sections. I would like to show a UIImage with some text next to it (not a cell), but I am not sure how I can go about doing that? The image and text need to match the background of the pinstripes.
...
I'm taking a tutorial for X-code that says this:
"Go into the code and change the references from DrinkArray to DrinksDirections."
What exactly does it mean?
I would show you the tutorial, except it's a book that costs money.
The only reference I found of DrinkArray is:
- (void)viewDidLoad {
[super viewDidLoad];
NSString *pa...
Hi,
I have a single MKMapView instance that I have programmatically added to a UIView. As part of the UI, the user can cycle through a list of addresses and the map view is updated to show the correct map for each address as the user goes through them. I create the map view once, and simply change what it displays with setRegion:animate...
I have a UITableView with 3 sections inside of a UIViewController. Is it possible to have other controls above the UITableView for example a UISlider or a UIImage? If so, how can this be accomplished?
Note: These controls should not be in a UITableViewCell, they should be part of the view.
...
I am using Winchain to develop on my Windows 7 machine. Here is my code:
iPhoneTest.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface iPhoneTest : UIApplication {
UITextView *textview;
UIView *mainView;
}
@end
iPhoneTest.m
#import "iPhoneTest.h"
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>...
I am trying to update a source image with the contents of multiple destination images. From what I can tell using premultiplied alpha is the way to go with this, but I think I am doing something wrong (function below). the image I am starting with is initialized with all ARGB values set to 0. When I run the function once the resulting ...
Why does this compile with out any errors or warnings?
@interface ObjectTest : NSObject {
}
-(void)iAmADoubleMethod;
-(void)iAmADoubleMethod;
@end
@implementation ObjectTest
-(void)iAmADoubleMethod {
NSLog(@"IAmADoubleMethod");
}
@end
I came across this in a project I am working on. I come from a C++ background, so I figure I wo...
I have a UITableView with a view in the header. This view has the pinstripe background and contains a UILabel. I want the UILabel text to look like the text of a section header. How can I achieve this?
...
Hi,
Is there any tutorial out there showing how to use OAuth on IPhone? Basically all of the tutorials are for twitter, i need something which work for any website, which has OAuth and give general view how to make it work on IPhone.
Thanks
...
Okay so I'm making something that basically works as a knob, but only half on the screen -- so I just need horizontal swipes to cause it to rotate. I have it nearly all sorted with one exception: if you change direction of your swipe in mid-swipe, the rotation doesn't change direction. I even can see the problem, but not sure what to do ...
I’m writing an objective-c program that does some calculations based on time and will eventually updates UILabels each second.
To explain the concept here’s some simplified code, which I’ve placed into the viewDidLoad of the class that handles the view.
- (void)viewDidLoad {
[super viewDidLoad];
// how do i make this stuff h...