I have a collection view that I've subclassed that allows me to reorder the collection view items via drag and drop. My drag code that sets up the pasterboard is currently in mouseDragged:
- (void)mouseDragged:(NSEvent *)aEvent {
if(!dragInProgress) {
dragInProgress = YES;
NSPasteboard *pboard = [NSPasteboard pasteboard...
I have a UIScrollView that's around 600pixels in height and 320 in width. So I'm allowing the user to scroll vertically.
I'm also trying to capture horizontal swipes on the view. The problem seems to be that when a user swipes horizontally with some accidental vertical movement, the UIScrollView scrolls and my touchesEnded delegate me...
Hi, im having problems with leak memory. The instruments show line "pagamento_" is a malloc. i dont have idea how resolve this.
i have following code: * dados is NSMutableArray, and im alloc in other place... and do release in dealloc.
NSString *path = [self caminho];
if (sqlite3_open([path UTF8String], &Banco) == SQLITE_OK){
if (s...
Does anyone know if it's possible to change the minute interval of a UIDatePicker after it's been added to a UIView? Is it possible to show and hide 2 different datePickers? I want change the minuteInterval of the UIDatePicker to 5 and 30 when I click a button. Any sample code would be appreciated.
...
I am implementing a search field where the user can type in a string to filter the items displayed in a view. Each object being displayed has a keywords to-many relationship, and I would like to be able to filter the objects based on their keywords. Each keyword object has a name property, so I've set up an NSPredicate to do the filter...
I have NSMutableDictionary object say obj. When I write it to the disk using
[obj writeToFile:filename atomically:YES] , the file does not get written to the disk. But the same set of statements work for a smaller mutable dictionary.
The first obj is (nonatomic, retain) property object of a class. The second smaller obj is a temporary ...
The below code behaves as expected however the compiler keeps telling me this:
warning: 'StatusViewController' may not respond to '-beginLoadingThreadData'
How do I get rid of that warning and most important why xcode believes that is the case?
here is my code:
[self beginLoadingThreadData]; // called in the loadDidView block
- (void...
I have been working on a project which uses Tiger's SQLite3 library (which if I remember well is contained in CoreData.framework?) and came across a problem when building with the "Release" config. I get linking errors telling me the sqlite3 symbols I use through my project are undefined. I'm pretty sure this is due to the needed sqlite3...
My exact model is complicated to explain, so say that I'm modeling fruits and their seeds in Xcode's Core Data modeler. Here's some "psuedo-coreData-code":
abstractEntity Fruit
attribute sweetness
relationship Seed
abstractEntity Seed
attribute shape
concreteEntity Apple inherits Fruit
concreteEntity Orange inherits Fruit
concreteEn...
I want to display current time in my iPhone app using my own custom graphics. What's the most efficient way to get the hours, minutes and seconds info? I thought about using NSDateFormatter to get each part but this seems to be too CPU intensive.
...
I have an application for Mac OS X that supports plugins that are intended to be loaded at the same time. Some of these plugins are built on top of a Cocoa framework that may receive updates in one plugin but not another. Given Objective-C's current method for function dispatching, any call from any plugin to a given Objective-C routine ...
I'm using NSKeyedArchiver to write out an NSDictionary of my app's data to the filesystem.
NSMutableData *data = [[NSMutableData alloc] init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver encodeObject:myAppsDictionary forKey:kDataKey];
[archiver finishEncoding];
BOOL success = [dat...
I'd like to add additional behavior to a class derives from NSManagedObject and there are 4 distinct (for now) groups of behaviors. I don't need my decorator class to be persisted with CoreData -- it's purely for adding run-time behavior.
However, if I try to apply the standard Decorator pattern, I can't call '[super init]', which make...
With an instance variable myArray:
@interface AppController : NSObject
{
NSArray *myArray;
}
Sometimes I see myArray initialized like this:
- (void)init
{
[super init];
self.myArray = [[NSArray alloc] init];
return self;
}
and sometimes I see it with a more complicated method:
- (void)init
{
[super init];
N...
This is probably a stupid question, but how can I execute a shell command from my Cocoa app?
I have the command as a string "command", but can easily manipulate data as needed.
There is no need to get a returned output value.
...
Hi to all
I want to know how to create a directory on a specified path.
I used "system("path of directory");" this is work fine in Simulator but not on Device
...
I'm trying to delete a section from a UITableView using animation and custom table section header UIViews.
I use...
//Deletion from my model done here (not shown) and then perform the deleteSections...
[self.tableView beginUpdates];
[self.tableView
deleteSections:[NSIndexSet indexSetWithIndex:index]
withRowAnimation:UITableViewRow...
Hi there,
I am going to develop on iPhone platform and I think the best way to learn is to read good apps' source.
Is there any open source iPhone app community? Like sourceforege or googlecode?
Thanks in advance~
...
Hi All,
I have a table and row contents(hard coded contents). when i choose one row and see the content and then come back to same table and try to choose another row, it doesn't deselect the first row selection(by default it shows Blue selection-UITableViewCellSelectionStyleBlue), instead both the rows are being in selected mode.
I wa...
I have two NSArrays, what I'm looking to do is to compare two arrays which contain strings, find the similarities and create the first array again but so they have no similarities.
Just for an example something like.
Two Arrays:
NSArray *arrayOne = [NSArray arrayWithObjects:@"TD1", @"TD2", @"TD3", nil];
NSArray *arrayTwo = [NSArray ar...