Hi
I would like to find the mount point of a volume for a given NSString path.
Though I'm a beginner in Cocoa and objective-C, I'm trying to do this "elegantly", ie. using one of the provided class, rather than making an external shell call or listing mounted filesystems and finding which one the path belongs to.
I did find NSWorkspac...
Hi
Is it possible to add events to iCal from my cocoa app? I tried using CalCalendarEvent but it didn't add anything to my calendar.
CalCalendarStore *calStore = [CalCalendarStore defaultCalendarStore];
CalEvent *event = [CalEvent event];
CalRecurrenceRule *recRule = [[CalRecurrenceRule alloc] initYearlyRecurrenceWithInterval:1 end:[C...
Hello!
The thing is I'm new on iPhone and Objective C development and I'd like to know what's the best way to call some function once you finished a task.
In my application what I do is load an internet hosted XML with some vars. To do this I have created this function called by the main view:
ApplicationVariablesLoader *loader = [ [ ...
Hello,
I have some custom, CoreAnimation based UI. I'd like to implement mouse dragging of certain CALayers and I'd like to stick an image of dragged layer to the cursor. The problem is, that I can't get the CALayer (which isn't image/.contents based) into an image of some kind - like CGImageRef or NSImage. Any ideas?
...
Hi,
i need to store an array of 40000 statics strings ( towns ).
how can i do this in objective C ?
Thanks, JP
...
HI all,,
I want to edit a html at run time ---- what i want to do is i have a html file on the server and i pass its tags in the other language as like this
NSString* contentHTML = [NSString stringWithFormat:@"<html><head></head><body><b><font face='arial' size='%d' color='%@'>%@</font></b></body></html>",[appDelegate.sTextFont intege...
I have a list of shops in a ListController file.
I've setted up a sqlite db, in which i've stored 60 shops.
On the top of the list i have a search bar.
I've made a class called DataController, that is responsible to load and store db datas.
@interface DataController : NSObject {
sqlite3 *database;
NSArray *shops;
NSDictionary* ...
In my app I have one root layer, and many images which are sublayers of rootLayer. I'd like to flatten all the sublayers of rootLayer into one layer/image, that don't have any sublayers. I think I should do this by drawing all sublayers in core graphics context, but I don't know how to do that.
I hope you'll understand me, and sorry for...
I'm having trouble passing a float value from one object to another. It appears to be fine in the first method, but in the second its value is huge. I assume this is some kind of a problem with my typecasting, because that's the thing I understand the poorest. Help is greatly appreciated!
In my game controller, I do this:
float accurac...
So my simple idea is to create an app that allows the user to report their location's latitude and longitude coordinates via email. You tap the button, the email screen comes up via the MessageUI framework, the To, Subject, and Body fields are already pre-entered, all that's needed is for the user to hit "send".
My problem, is that I n...
How do I programmatically select a tableview row so that
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
gets executed? selectRowAtIndexPath will only highlight the row.
...
I am carrying out a number of calculations using NSDecimal and am creating each NSDecimal struct using the following technique:
[[NSNumber numberWithFloat:kFloatConstant] decimalValue]
I am using NSDecimal to avoid using autoreleased NSDecimalNumber objects (if the NSDecimalNumber approach to accurate calculations is used). However it...
I've started to move to using NSViewControllers and I can't for the life of me figure out how to get content from a CoreData entity to a TableView (for example) through a NSViewController?
...
Both work, but... Which one would you use and why ?
@implementation NSString (Extender)
-(NSString *) stringByTrimmingPrefix:(NSString *)strPrefix
{
while ([self hasPrefix:strPrefix])
{
self = [self substringFromIndex:strPrefix.length];
}
return self;
}
@end
or
@implementati...
I have a group of classes (say for validation rules). Each one returns a true or false.
I use id and call a method signature for each one of the classes and get the results allowing me to dynamically create validation rules.
Worked great until...
I have a new class that takes an extra parameter to come up with its validation.
What i...
I expected this code to replace the hate with some love.
NSMutableString *teststring=@"I hate programming my iPhone";
NSString *overwriteSource=@"love";
NSRange temprange=NSMakeRange(2, 4);
[teststring replaceCharactersInRange:temprange withString:overwriteSource];
NSLog(@"%@",teststring);
This terminates due to an uncaught e...
I had a question regarding the use of asterisks in Objective-C. Just to be clear: I understand what pointers are and everything in procedural C. I was wondering two things though:
1) Why are all (references to) Objective-C objects pointers? Why not plain variables? (i.e. NSArray array = [[NSArray alloc] init];)
2) Why do you omit the a...
Hi,
take example:
-(void)setName:(NSString *)name age:(int)age;
How would you call this method (in other words, the method's name is setName but what is the "age" parameter doing in there) and what do the types in parentheses mean? Is it just a way to tell the compiler what types are being returned?
...
Ok, I've run into a small issue here. I'm trying to filter two things in my UITextField. They include limiting the number of characters and filtering the type of characters. I can get each one to work by there self but they both don't work together. It may have something to do with the double returns, idk. Hopefully someone can look at m...
I have a predicate that looks like
[NSPredicate predicateWithFormat:@"region=%@ && locality CONTAINS %@", self.region, query];
I want it to match ignoring case. Whats the trick?
...