Duplicate:
Custom colors in UITabBar
The iPhone UITabBar generally uses a blue and gray icon scheme. However, the iPod Touch ships with an application from Nike that has a red icon overlay, as opposed to the blue overlay. Here's a screen shot:
Image Link
How do I do that? Do I use the hidden setSelectedImage method in UITabBar...
I'm trying to design how to implement a relatively simple application.
I want to create a grid of 'squares' that cover an entire screen. Each square should have the ability to respond to touch events, and then have an on/off state. For example, if I touch an 'off' square, and then drag my finger across 10 other squares, I want them ...
I'm using NSUSerDefaults to store user preferences. I remember reading somewhere that setting the keys as constants is a good idea - and I agree. The following code is what I currently have:
[[NSUserDefaults standardUserDefaults]
setObject:[NSNumber numberWithInt:polygon.numberOfSides]
forKey:@"polygonNumberOfSides"]...
I'm trying to lay out some images in code using addSubview, and they are not showing up.
I created a class (myUIView) that subclasses UIView, and then changed the class of the nib file in IB to be myUIView.
Then I put in the following code, but am still getting a blank grey screen.
- (id)initWithFrame:(CGRect)frame {
if (sel...
I've run into this problem a couple times now. Last time, I wanted to create an array of arrays (matrix) of BOOL's. I ended up encapsulating them in NSStrings, because apparently NSArray only has arrays of objects.
This time, want an array of arrays again, but of CGPoints. I'm going to be using these to draw images to the screen...
I'm working on Cocoa Application that should be able to analyze and highlight a source code written in such languages as Objective-C, SQL, JavaScript, Python etc. The text should be editable too (by using NSTextView, for example).
Please advise what is the best way to implement such feature in Mac OS X 10.5.
There is no need to support...
How can I get a list (in the form of an NSArray or NSDictionary) of a given object attributes in Objective-C?
Imagine the following scenario: I have defined a parent class which just extends NSObject, that holds an NSString, a BOOL and an NSData object as attributes. Then I have several classes which extend this parent class, adding a...
Duplicate:
can i use highlighted the table view cell without default blue color in objective c?
How can I change the default blue color when selecting the row of UITable?
...
I want to doing a project where i need to connect to iphone music library. When my application is start music file is add my application and play when i want.
...
Hi,
Can someone please explain why the following code causes my app to bomb?
NSData *myImage = UIImagePNGRepresentation(imageView.image);
:
[myImage release];
If I comment out the 'release' line, the app runs... but a few times calling the function containing this code and I get a crash - I guess caused by a memory leak.
Even if I...
I want to know the serial number of my iPhone using my application. I have writen code below.
- (NSString*)getSerialNumber
{
CFTypeRef serialNumberAsCFString;
io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
if (platformExpert)
{
serialNumberAsCFStr...
I need to generate HMAC-SHA1 in Objective C. But i didnt find anything that works. I tried with CommonCrypto, using CCHMAC, but didnt works. I need to generate a hmac and after generate HOTP number.
Somebody have any example code in Objective C or C?
...
I know that if you do the following you most certainly have a memory leak:
id foo = [[NSObject alloc] init];
foo = nil;
But, what if you're using self.foo, a property with retain? And your code instead looks like the following:
foo = [[NSObject alloc] init];
self.foo = nil;
Is that still a memory leak since the accessor releases th...
mobclix.com has an API for integrating with facebook.com. Is there something similar for twitter.com and other social services? Meaning, these will look like native parts of your app?
...
How do I strip out the white space chars from an NSString ?
Consider the following example:
NSString *tmpString = @" Hello this is a long string! ";
I want to convert that to: "Hello this is a long string!".
I have tried a function like this, but it's not working:
-(NSString *)cleanupString:(NSString *)theString
{...
I have a singleton class, and can't unit test their code.
I have test like:
Db *db = [[Db alloc] initWithName:@"sample.db"];
[db createDb];
STAssertEquals([db existDb],YES,@"The db is not created!");
But only work the first. When the second is executed, I always get "null" from the initWithName method. When I remove the singlet...
i am new to iphone development..
so from where i should start learning...
pls tell me step by step to guide
...
Hello stackoverflow. I'm new to Objective-C, and I can't figure out why the NSString objects in my array of Car objects seem to have been released.
Here's my Car.m class:
#import "Car.h"
@implementation Car
@synthesize categoryId;
- (id)initWithPrimaryKey:(NSInteger)pk categoryId:(NSNumber *)catId carName:(NSString *)n {
if (self...
Hi,
Can someone confirm that nested C structures are NOT allowed in objective C.
And by nested structs, I mean the following;
struct Tex2D
{
GLfloat u;
GLfloat v;
};
// quad uv cords
struct TexQuad
{
Tex2D uv[4];
};
I seem to have all kinds of problems compiling this. It's difficult to find any documentation on this as ...
I have an NSDocument which has the following structure:
@interface MyDocument : NSDocument
{
NSMutableArray *myArray;
IBOutlet NSArrayController *myArrayController;
IBOutlet MyView *myView;
}
@end
I instantiate the NSArrayController and the MyView in MyDocument.xib, and have made the connections to the File's Owner (MyDoc...