Re: Size of a file on disk

2011-08-31 Thread Hank Heijink (Mailinglists)
See the documentation for - (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error in NSFileManager. The returned dictionary has a convenience method -fileSize. Best, Hank On Aug 31, 2011, at 3:51 PM, Jon Sigman wrote: > How does one determine the size of a file on dis

Re: Memory management and returned values from methods...

2011-07-15 Thread Hank Heijink (Mailinglists)
On Jul 15, 2011, at 3:38 PM, Kevin Muldoon wrote: > Hey guys, > > I know of at least one way to fix this memory leak but I'm hoping to find a > few more ways. > > I'm chewing through a text file of 205,960 lines in a C while loop. All is > good until MyObject returns a value. Of course the ret

Re: Noob question in regards to NSXMLParser

2011-06-07 Thread Hank Heijink (Mailinglists)
Two ways that I've used: 1. Keep a boolean isInCurrentConditions that you set when you start the current_conditions element and reset when you end that element. Then every time you enter a condition element you check the boolean to see if you are where you need to be in the hierarchy. This work

Re: What is the point of a host-reachability test that doesn't test the reachability of the host?

2011-06-02 Thread Hank Heijink (Mailinglists)
On Jun 2, 2011, at 1:44 PM, Jim Adams wrote: > True. But the situation we were running into was that a server might not be > up and I could tell faster with ping than a timer. The point (that others have already made) is not that ping is fast, but that (a) a successful ping doesn't tell you if

Re: Defining code based on build target

2011-05-18 Thread Hank Heijink (Mailinglists)
Try #ifdef instead of #if. On May 18, 2011, at 4:09 PM, Development wrote: > I have a version of an application that I want to contain different code > based on the builded target. > for instance I have a lite version. After defining the ISFREE value in the > preprocessor macros... I tried usin

Re: XML Resource Release

2011-05-18 Thread Hank Heijink (Mailinglists)
On May 18, 2011, at 1:55 PM, Bing Li wrote: > Dear all, > > I am creating an XML chars to transmit over TCP. When an XML is created, I > attempt to release some resources. However, I got some weird results. > > The XML is simple as follows. > > > >2412432 >greatfree >1

Re: Why NSClassFromString(@"CADisplayLink")?

2011-05-10 Thread Hank Heijink (Mailinglists)
On May 10, 2011, at 6:34 AM, Brian Bruinewoud wrote: > Hi All, > > Just curious, why does this work (compiles and runs): > >displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget: > tapped selector:@selector(respond:)]; > > But this doesn't link because the CADisplayLink

Re: Arbitrary Shaped Windows

2011-04-29 Thread Hank Heijink (Mailinglists)
Have you looked at this? http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html Hank On Apr 29, 2011, at 2:16 PM, Abhinav K Tyagi wrote: > Hi Laurent, > > I too agree with you on this. The circular shape i just mention as a case. > It can be any shape. > > Its just an idea..

Re: iOS - AudioSession Category to play in sleep mode

2011-04-26 Thread Hank Heijink (Mailinglists)
Gen...etc) > > How to derive the number of samples for different Sampling Rate? (As per the > Apple document 4096 samples @ 44.1kHz) > > Thanks > Sasikumar JP > > On 26-Apr-2011, at 8:44 PM, Hank Heijink (Mailinglists) wrote: > >> You're thinking of kAudio

Re: iOS - AudioSession Category to play in sleep mode

2011-04-26 Thread Hank Heijink (Mailinglists)
You're thinking of kAudioUnitProperty_MaximumFramesPerSlice (http://developer.apple.com/library/ios/#qa/qa1606/_index.html). You have to set that to 4096 frames per slice for every audio unit that's not the remoteIO unit. Hank On Apr 26, 2011, at 11:05 AM, Gregory Wieber wrote: > In the iOS d

Re: UIView/NSView doesn't display changing data in real time

2011-04-19 Thread Hank Heijink (Mailinglists)
On Apr 19, 2011, at 1:51 PM, Frederick C. Lee wrote: > Greetings: > > Simple scenario: background thread is computing data to be displayed in real > time within the main thread. > Data: dynamic/variable data that is converted into a NSString type within a > background thread, displayed withi

Re: Trying to subclass UISwitch

2011-04-05 Thread Hank Heijink (Mailinglists)
Typing "customize uiswitch" into Google returned this as the second hit: http://osiris.laya.com/projects/rcswitch/ Might be worth looking at. Hank On Apr 4, 2011, at 10:22 PM, Philip Ershler wrote: > The first thing I tried to do was to subclass the UISwitch. But when one > looks at the docs

Re: NSMutableArray contract

2011-04-01 Thread Hank Heijink (Mailinglists)
On Apr 1, 2011, at 9:49 AM, Carlos Eduardo Mello wrote: > The objects in this array are the main thing in my app. Various parts of the > UI direct actions to each one of them, when they are selected (only one at a > time). The objects contain a path which is drawn and used for hit detection > a

Re: NSMutableArray contract

2011-04-01 Thread Hank Heijink (Mailinglists)
On Apr 1, 2011, at 9:29 AM, Carlos Eduardo Mello wrote: > Hi people, > > I just realized I may be doing something dangerous with an NSMutableArray. I > searched Guides and References on this but couldn't find an explicit answer: > > - Does an NSMutableArray guarantee to retain an object on addO

Re: iOS - Play streaming(mp3) audio with effects

2011-03-31 Thread Hank Heijink (Mailinglists)
On Mar 30, 2011, at 11:14 PM, Sasikumar JP wrote: > I am new to iOS Audio Technology. > I am developing an application which will play streaming audio(mp3), planning > to add some effects like iPod Equalizer,Pan Control. > > I have tried to use Matt Gallagher's AudioStreamer API > (http://cocoa

Re: Parsing XML to CoreData

2011-03-24 Thread Hank Heijink (Mailinglists)
On Mar 24, 2011, at 12:06 PM, Siegfried wrote: > So, after discussing some methods to import and export a CoreData database, I > ended up sticking with my initial XML idea. > > Now I'm stuck in a problem when parsing that is probably simple, but I can't > solve. Basically, my XML is like this:

Re: What is the expected Cocoa API behavior in an incomplete object traversal?

2010-10-15 Thread Hank Heijink (Mailinglists)
On Oct 15, 2010, at 3:42 PM, Tito Ciuro wrote: > Hello, > > I'm implementing a method and I'm not sure what the behavior should be when > detecting an anomaly. > > Case in point: I have a method that iterates through an array of objects. As > I traverse the array, I'm, checking whether the obj

Re: NSScanner Failing with EXC_BAD_ACCESS

2010-10-15 Thread Hank Heijink (Mailinglists)
On Oct 15, 2010, at 2:44 PM, Chris Tracewell wrote: > NOTE :: GC Enabled > > I am using an NSScanner in an NSString category but am crashing whenever I > try to log the string I scanned into or to return it. If I comment out the > NSLog there are no problems. > > NSString *theScannedString; I

Re: Question in regards to iTunes XML

2010-09-22 Thread Hank Heijink (Mailinglists)
On Sep 22, 2010, at 2:38 PM, Eric E. Dolecki wrote: > I've been asked to take the iTunes XML file from a few people and provide a > picker to choose which one to use. That's the easy part. So I have a few of > the XML files and slapped them on a server, etc. however each one averages > about 5MB i

Re: [iPhone] NSManagedObjectContext save doesn't crash but breaks on objc_exception_throw

2010-06-08 Thread Hank Heijink (Mailinglists)
not worry about it? Hank >>> Am 08.06.2010 um 17:53 schrieb Hank Heijink (Mailinglists): >>> >>>> Dear all, >>>> >>>> I've run into the following problem, and I'm a bit stuck - I wonder if you >>>> can shed some

Re: [iPhone] NSManagedObjectContext save doesn't crash but breaks on objc_exception_throw

2010-06-08 Thread Hank Heijink (Mailinglists)
t not the call to objc_exception_throw. In case it matters, this is on iPhone OS 3.1.3, Xcode 3.2.2. Thanks, Hank On Jun 8, 2010, at 12:08 PM, Alexander Spohr wrote: > Is there anything in the log? > What does save's error parameter return? > > atze > > > Am 0

[iPhone] NSManagedObjectContext save doesn't crash but breaks on objc_exception_throw

2010-06-08 Thread Hank Heijink (Mailinglists)
Dear all, I've run into the following problem, and I'm a bit stuck - I wonder if you can shed some light on this. I have an iPhone app that uses Core Data, and the problem occurs when the app terminates. I have an NSOperationQueue with potentially several NSOperations that are cancelled in the

Re: [iPhone] -UIScrollView

2010-06-01 Thread Hank Heijink (Mailinglists)
On Jun 1, 2010, at 5:09 PM, Fritz Anderson wrote: > On 31 May 2010, at 11:58 PM, Development wrote: > >> I have a Scroll view that contains a master view. This master view adds page >> sized views of image data, specifically PDF data. The problem that I am >> having is that if I load all these

Re: getting file creation date from NTFS

2010-05-22 Thread Hank Heijink (Mailinglists)
On May 22, 2010, at 11:33 AM, Angelo Chen wrote: > Hi, > I'd like to get creation date of a file, here are the codes: > NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path > traverseLink:YES]; NSLog(@"Dict %@", fileAttributes); > This works if the file came from FAT or Mac

Re: Delayed Autorelease

2010-04-08 Thread Hank Heijink (Mailinglists)
On Apr 8, 2010, at 11:03 AM, Patrick M. Rutkowski wrote: > It turns out that my memory error is coming form somewhere else. If > you don't mind changing the topic of the thread for a moment: > > I have a Foo object which has an NSMutableArray of Bar objects. The > Bar objects each have their own

Re: Delayed Autorelease

2010-04-08 Thread Hank Heijink (Mailinglists)
On Apr 8, 2010, at 10:36 AM, Patrick M. Rutkowski wrote: > Is it common in either Cocoa or UIKit to have an autorelease run > happen only when the user does something? > I'm in a situation where I believe the autorelease run is happening > only when I push a bush or otherwise fiddled with a UI it

Re: Core Data: fetching a subset of attributes/columns

2010-03-20 Thread Hank Heijink (Mailinglists)
On Mar 20, 2010, at 1:52 PM, Gabriel Fernandez wrote: > I wanted to get a subset of an entity's attributes because one of the > ManagedObject's attributes is a large image. You might consider another design: one that defines two entities, such that the image attribute of your object is replace

Re: Question Re Memory Management in Apps

2010-03-09 Thread Hank Heijink (Mailinglists)
On Mar 8, 2010, at 10:44 PM, Philippe Sismondi wrote: > In other words, the MadeObj instance for AppController's instance variable is > created and then immediately dealloc'd. I take this to mean that the > autorelease pool it was in was released/drained. If I change the > AppController init me

Re: setAction:@selector is not working ?

2010-02-19 Thread Hank Heijink (Mailinglists)
On Feb 19, 2010, at 2:43 PM, David M. Cotter wrote: > just before the line of code that pops up the menu, i iterate over all the > items > so yes, i am absolutely sure it is getting called > and i am absolutely sure that myMenuItem is non null Posting you code is wildly more helpful than describ

Re: NSWindow - how to resize it keeping aspect ratio?

2010-02-18 Thread Hank Heijink (Mailinglists)
On Feb 18, 2010, at 1:55 PM, Alexander Bokovikov wrote: > Hi, All, > > I'm sorry if this is a stupid question, but I don't see an evident answer... > I need the subj, but don't see appropriate NSWindow method... Am I missing > something? Implement the NSWindow delegate method - (NSSize)windowW

Re: The 64 pixels width limit on Windows

2010-02-18 Thread Hank Heijink (Mailinglists)
On Feb 18, 2010, at 10:08 AM, Eric Gorr wrote: Measure from the left edge of the window to the rightmost edge of the maximize button: 64 pixels. I doubt you can adjust it, but who knows - maybe if you get rid of the title bar? >>> >>> Can one override the 64 pixel limit? >> >> I

Re: The 64 pixels width limit on Windows

2010-02-17 Thread Hank Heijink (Mailinglists)
On Feb 17, 2010, at 4:55 PM, Eric Gorr wrote: > On Feb 4, 2010, at 3:13 PM, Hank Heijink (Mailinglists) wrote: > >> On Feb 4, 2010, at 2:51 PM, Eric Gorr wrote: >> >>> When I am resizing my window, I have a delegate method >>> windowWillResize:toSize: whic

Re: Simple Cocoa App Not Working

2010-02-09 Thread Hank Heijink (Mailinglists)
On Feb 9, 2010, at 9:21 AM, Donald Klett wrote: > I am trying to learn Cocoa and wrote a simple app using the MVC pattern. The > view controls two text fields, the controller receives events from a single > button, and the model receives the value entered into the first text field, > and then

Re: Dumb question about Core Data

2010-02-04 Thread Hank Heijink (Mailinglists)
If you create your data model in Xcode with its data modeling facility, you can give it a default value right there, when you select the attribute (no need to recreate the Player.m and Player.h files). If you need to set different default values each time, just create the Player instance and set

Re: windowWillResize: where does the 64 pixel limit come from?

2010-02-04 Thread Hank Heijink (Mailinglists)
On Feb 4, 2010, at 2:51 PM, Eric Gorr wrote: > When I am resizing my window, I have a delegate method > windowWillResize:toSize: which is being called. What I am finding odd is that > the width of the size being passed in will never go below 64 pixels even if > the width for contentMinSize and

Re: (void *)contextInfo

2010-01-12 Thread Hank Heijink (Mailinglists)
On Jan 12, 2010, at 2:51 PM, Rainer Standke wrote: > I am trying to get some contextinfo across while a sheet is displayed. > > Here is the code that displays the sheet: > > NSArray *theContextInfo = [[NSArray alloc] init]; > theContextInfo = [NSArray arrayWithObject:objTBD]; You're leak

Re: Custom sheet question - which variable?

2010-01-10 Thread Hank Heijink (Mailinglists)
That example assumes you have an instance variable called myCustomSheet in your class. You can tell from the method signature of the following method (called in the example you refer to) what type it should be: - (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindowmodalDelega

Re: iPhone interruption with OpenAL?

2010-01-10 Thread Hank Heijink (Mailinglists)
Check the docs: http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html There's a section called "OpenAL and Audio Interruptions" that explains it. Good luck, Hank On Jan 10, 2010, at 4:23 A

Re: iPhone: Autorotation for a subview

2009-12-22 Thread Hank Heijink (Mailinglists)
On Dec 22, 2009, at 12:51 PM, Eric E. Dolecki wrote: > I have a view which controls it's UI when rotated. However, if there is a > subView in place, it rotates and I'd like to control it's UI too. In my > subView the willAnimateRotationToInterfaceOrientation doesn't get fired. I > set up the shoul

Re: memcpy with 64 bit

2009-12-14 Thread Hank Heijink (Mailinglists)
On Dec 14, 2009, at 1:27 PM, gMail.com wrote: > Hi, > if I compile this code against "32-bits Universal", it works. > If I compile this code against "64-bit Intel", it doesn't work. > I get a bad access error just on memcpy. What do I miss? I use: > >Base SDK 10.6 >i386 ppc ppc64 ppc7400

Re: NSTableView retain count problem

2009-11-21 Thread Hank Heijink (Mailinglists)
> @interface DataViewController : MainViewController { > … > NSMutableArray *records; > } > > - (id) init > { > records = [[NSMutableArray alloc] init]; > } > > - (int) createDictionary > { > [records autorelease]; I'm assuming you're not using GC since you're loo

Re: NSRunloop + shared thread

2009-11-21 Thread Hank Heijink (Mailinglists)
On Nov 21, 2009, at 11:39 AM, Colin Deasy wrote: > Hey, > > Thanks for the info. I'll certainly look into the CFNetwork API. I was really > hoping for a nice solution to come about for the cocoa API's but I've since > given up hope and started using libcurl, which is actually a really nice >

Re: NSRunloop + shared thread

2009-11-20 Thread Hank Heijink (Mailinglists)
On Nov 19, 2009, at 7:51 PM, Jens Alfke wrote: > On Nov 19, 2009, at 3:40 PM, Colin Deasy wrote: > >> This shared thread is actually handling potentially large numbers of >> concurrent url connections/downloads. The reason that I want a block in some >> of those at different times is a for a fo

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Hank Heijink (Mailinglists)
On Nov 12, 2009, at 5:59 AM, Jeremy Pereira wrote: for (NSUInteger i = 0; i < nTags; i++) { unsigned long pcLength = 0; if (getLengthOfMetaData(fileHandle, metadataTags[i], 0, &pcLength) != 0) continue; Religious rant first: The above line is an abomination in my o

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-12 Thread Hank Heijink (Mailinglists)
-initWithCString:encoding: should copy the bytes. You can verify that yourself with a small test: char buf[10+1] = "0123456789"; NSString *s = [[NSString alloc] initWithCString:buf encoding:NSASCIIStringEncoding]; NSLog(@"before %@", s); memset(buf, 'x', 10); NSLog(@"after %@

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-11 Thread Hank Heijink (Mailinglists)
True. I'd better check for that - thanks! However, I'd have gotten a crash at that line, not confused memory management. I'm not catching any exceptions that would muffle this one. Hank On Nov 11, 2009, at 5:07 PM, Aki Inoue wrote: Another possibility. Since you're asking to instantiate t

-[NSString stringWithCString:encoding:] memory management question

2009-11-11 Thread Hank Heijink (Mailinglists)
Hi all, I've run into a funny crash when using -[NSString stringWithCString:encoding:]. The code in question runs in the iPhone Simulator. I haven't found anything on the web about this, but I found out some things by experimenting. I have a workaround, but I'm curious what's going on. I'

Re: Odd behavior of [NSDateFormatter dateFromString] with short years?

2009-11-03 Thread Hank Heijink (Mailinglists)
On Nov 3, 2009, at 10:06 AM, marc hoffman wrote: Hi, im running into some very odd behavior when using a ShortStyle date formatter for entering dates, and using single vs double digit year numbers. typing the year as either "2009" or "09" works as expected, but typing it as "9" not only

Re: View shifted up on iPhone simulator

2009-10-02 Thread Hank Heijink (Mailinglists)
I second the previous poster's opinion: view controllers are definitely the way to go here. They'll let you take care of rotation and plenty of other stuff: read the view controller programming guide. Using a view controller gives you many more places to customize what happens. There's vi

Re: View shifted up on iPhone simulator

2009-10-02 Thread Hank Heijink (Mailinglists)
I believe -[UIScreen applicationFrame] returns different values for phone and simulator in OS 3.0. From your screenshots I have no idea if that's your problem though. Did you layout your view in IB or did you do that programmatically? Best to set a breakpoint where you position your content

Re: NSInvocation or NSTimer with an arg

2009-09-17 Thread Hank Heijink (Mailinglists)
l when the cell's shift down? I need to store something in userInfo that tells me or helps me definitively find the correct Cell to update ... Thanks, -Luther On Wed, Sep 16, 2009 at 8:08 PM, Hank Heijink (Mailinglists) > wrote: On Sep 16, 2009, at 8:24 PM, Luther Baker wrote:

Re: NSInvocation or NSTimer with an arg

2009-09-16 Thread Hank Heijink (Mailinglists)
On Sep 16, 2009, at 8:24 PM, Luther Baker wrote: I'd like to fire a simple callback every .1 of second (yes, my stopwatch style app). But in that callback, I need access to a corresponding UITableViewCell. Unfortunately, I don't see a way to choose a selector with a UITableViewCell argument

Re: Strangest UITable bug

2009-09-07 Thread Hank Heijink (Mailinglists)
Do you want help guessing or help solving? If you're after the latter, you should post your code. Hank On Sep 7, 2009, at 9:10 PM, Development wrote: Ok I have the weirdest UITableViewBug.. I've set up the delegate, datasource, etc. My data appears correctly in the table. HOWEVER, when I c

Re: Why I have a leak? I am unable to understand

2009-08-24 Thread Hank Heijink (Mailinglists)
On Aug 24, 2009, at 8:20 PM, Agha Khan wrote: HI: I know the leak is in next 2 lines I have commented all the code except these 2 lines. // NSTimeInterval NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; unsigned unitFlags = NSYearCalendarUnit |

Re: I have a Corrupt data

2009-08-21 Thread Hank Heijink (Mailinglists)
I seem to remember you do iPhone development, so I'll answer from there, inasmuch as I can: you're not giving us much to work with here. As to your last question: there is no way to gracefully exit the application. On an iPhone, you can't force an exit that doesn't look like a crash to the

Re: How to change to the smoother single-stage animation

2009-08-08 Thread Hank Heijink (Mailinglists)
I have removed both function but now my device doesn't know if it is in horizontal or vertical position. I need that information to arrange some controls according to its Orientation. The first parameter of the willAnimateRotationToInterfaceOrientation:duration: method should tell you tha

Re: Two right buttons on UINavigationBar?

2009-08-06 Thread Hank Heijink (Mailinglists)
If one of your buttons is always hidden, why do you need two buttons? You can just use one button and change the title, target, and action when you need to. If necessary you can even replace the whole button. Hank On Aug 6, 2009, at 1:47 AM, Agha Khan wrote: Hi: I have a UINavigationBar wh

Re: How to change to the smoother single-stage animation

2009-08-06 Thread Hank Heijink (Mailinglists)
This is new in iPhone OS 3.0. From the documentation for UIViewController: - (void)willAnimateFirstHalfOfRotationToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientationduration: (NSTimeInterval)duration [...] The default implementation of this method does nothing. If you

Re: [iPhone] Zero opacity causes UIView to go numb

2009-07-23 Thread Hank Heijink (Mailinglists)
Completely transparent views (opacity 0.0) don't receive touch events - you're not missing anything there. As you have found, a little opacity is enough to catch them again. Depending on what's in your view, you might be able to set the background color to [UIColor clearColor] to get the sa

Re: [iPhone] Network connection between 2 iPhones

2009-07-13 Thread Hank Heijink (Mailinglists)
Have a look at the Witap code sample. It finds other iPhones over Bonjour and connects sets up a socket connection (I believe it uses CFNetwork, but I don't have it handy right now). If you need more info, look at the CFNetwork programming guide - CFNetwork isn't that bad, and the guide con

Re: link a web page from a view

2009-07-08 Thread Hank Heijink (Mailinglists)
for documentation on -[UIApplication openURL:]. Which control to use to receive the user's tap depends on what your view contains. It could be a UIButton or you could just use a UIWebView and implement its delegate protocol to intercept the tap on a link and open it in Safari. Best,

Re: Sqlite3

2009-04-09 Thread Hank Heijink (Mailinglists)
On Apr 8, 2009, at 8:24 AM, fawad shafi wrote: i m working on sqlite3 database, problem is this that, when i insert data in database from simulator, n after this when i go to sqlite3 terminal. the data is not available there. more strange is that after inserting data from simulator, when i

Re: Clarification regarding viewDidAppear: and friends

2009-03-28 Thread Hank Heijink (Mailinglists)
list first to make sure I'm not missing something obvious. I'd file the request. Good luck, Hank Hank Heijink hankh at runbox dot com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderato

NSCollectionView and bindings to text fields in tab view

2008-08-13 Thread Hank Heijink (Mailinglists)
ne recommend a workaround? Should I, for instance, set the bindings programmatically? Oh, and in case it matters, I'm using Mac OS 10.5.4, Xcode 3.1, and IB 3.1. Many thanks, Hank Hank Heijink Columbia University ___ Cocoa-dev mailing li

Re: how to prevent sleep mode when app is running

2008-06-12 Thread Hank Heijink (Mailinglists)
Look into UpdateSystemActivity(). It's in the CoreServices framework. If you call it with UsrActivity every 25 seconds or so, the display won't dim and the computer won't go to sleep (unless it's forced to. You can't prevent that). What is your app doing that you want to resort to something

Re: Breakpoint for unknown selector

2008-05-23 Thread Hank Heijink (Mailinglists)
Try the NSObject method -doesNotRecognizeSelector: "The runtime system invokes this method whenever an object receives an aSelector message it can’t respond to or forward. This method, in turn, raises an NSInvalidArgumentException, and generates an error message." Hank On May 23, 2008, a

Re: Trying to understand -- please help...

2008-05-21 Thread Hank Heijink (Mailinglists)
On May 21, 2008, at 12:49 PM, Gérard Iglesias wrote: with an empty NSArray (not very useful, since you can't add items to an NSArray). Then, you leak that allocated memory by setting cityArray to an autoreleased NSArray In fact it is not leaking, it is just creating an object for nothing,

Re: Trying to understand -- please help...

2008-05-21 Thread Hank Heijink (Mailinglists)
On May 21, 2008, at 12:05 PM, john darnell wrote: - (id) init { cityArray = [[NSArray alloc] init]; NSString *c0 = @"New York"; //Ten NSString objects created here ... NSString *c9 = @"Virginia Beach"; cityArray = [NSArray arrayWithObjects: c0, ...c9, nil]; return self; } Here's

Re: Writing Cocoa framework's for iPhone

2008-05-21 Thread Hank Heijink (Mailinglists)
On May 21, 2008, at 9:46 AM, Michael Ash wrote: I "agreed" to similar contracts every time I've installed Mac OS X and Xcode and nobody ever got annoyed when I talked about *those* in a public forum. You agreed, not "agreed". Checking the box is legally binding. It doesn't matter if you've

Re: iPhone: Question about keyboard / drawing

2008-05-15 Thread Hank Heijink (Mailinglists)
I don't know how many times this has already come up: until the NDA is lifted, you can't ask questions about the iPhone SDK on this list. On May 15, 2008, at 12:52 PM, Stuart Carnie wrote: If I want to implement my own keyboard, I'd like it to behave similarly to the built-in iPhone keyboard

Re: How to convert UInt8 array to NSString

2008-05-05 Thread Hank Heijink (Mailinglists)
+[NSString stringWithUTF8String:] is what you're looking for. I *think* UInt8 and char are always the same size, but I'm not 100% sure if you can always depend on that. If you can, you can just feed your UInt8 array to the function. Hope this helps, Hank On May 5, 2008, at 8:17 AM, Marc Lo

Re: -charactersIgnoringModifiers and the shift key

2008-04-17 Thread Hank Heijink (Mailinglists)
I assume you picked cmd-shift-[ because the curly brace makes sense, in which case you really are looking for cmd-{. If someone has a keyboard where the shifted version of [ is @ (no idea if such a keyboard actually exists), you might not want your shortcut to be cmd- shift-[. So, I think

Re: addObjectsToArray: behaving badly - why?

2008-04-12 Thread Hank Heijink (Mailinglists)
Are you sure self.dependencies isn't returning nil? That'd explain it. Hank On Apr 12, 2008, at 10:42 PM, K. Darcy Otto wrote: My code used to look like this: NSMutableArray *newDependencies = [self.dependencies mutableCopy]; [newDependencies addObjectsFromArray:[aDependency de

Re: Reformatting percent string to two decimal places

2008-04-08 Thread Hank Heijink (Mailinglists)
This seems like a lot of trouble to go to. Why not do something like this? NSString *inString = @"64.123456%"; NSString *outString = [NSString stringWithFormat:@"%.2f%%", [inString doubleValue]]; Hank On Apr 8, 2008, at 11:07 AM, Lorenzo Thurman wrote: I have the string representation of

Re: Main Thread UI and Detached Thread

2008-03-31 Thread Hank Heijink (Mailinglists)
t of sense if that updates faster than your user can read anyway, so you might want to tone down the update speed. Hank Hank Heijink (Mailinglists) wrote: Just checking the obvious here - is it possible that your worker thread completes its work so fast that the main run loop hasn't up

Re: Main Thread UI and Detached Thread

2008-03-31 Thread Hank Heijink (Mailinglists)
Just checking the obvious here - is it possible that your worker thread completes its work so fast that the main run loop hasn't updated the screen once before it's done? Keep in mind that the main thread has to display your window with the progress bar and the text and (depending on your i

Re: Autorelease question

2008-03-13 Thread Hank Heijink (Mailinglists)
On Mar 13, 2008, at 9:19 AM, Daniel Luis dos Santos wrote: NSDictionary *index = [NSDictionary dictionaryWithContentsOfFile: indexFilePath]; This dictionary is autoreleased when it's given to you, hence the error when you try to release it. Refer to

Re: NSTimer and seg faults

2008-03-12 Thread Hank Heijink (Mailinglists)
You're getting an autoreleased date and autoreleased timer from the methods you call, but you're not retaining either your timer our your date, so they'll both be gone after you leave awakeFromNib. Read the memory management guide for how all this works:

Re: Using an auto incremented NSNumber as attribute in a NSManagedObject

2008-03-06 Thread Hank Heijink (Mailinglists)
It's a little busy at the developer website, since they just announced the iPhone SDK. I think there's nothing to do but wait... Best, Hank On Mar 6, 2008, at 4:05 PM, Joshua Preston wrote: Hey guys, First, let me say that I'm just starting to pick up Cocoa and Objective-C, and so far, I

Re: Tabless NSTabView IB3 Bug

2008-03-04 Thread Hank Heijink (Mailinglists)
There is a way, but I did like the IB 2.0 way better... Change the view mode of the main IB window to list or column view and navigate to your tabview. If you double click on the individual tab view items, your document will change to the tab view item you select. Hank On Mar 4, 2008, at 1

Re: Drawing from secondary thread erases resize corner in window?

2008-02-29 Thread Hank Heijink (Mailinglists)
Sent a message to the list from the wrong account, so it bounced. Here it is: On Feb 28, 2008, at 5:01 PM, Hamish Allan wrote: You could try kCFRunLoopCommonModes (pre-Leopard) / NSRunLoopCommonModes (post-Leopard). I believe that NSDefaultRunLoopMode and NSEventTrackingRunLoopMode are in the

Re: Drawing from secondary thread erases resize corner in window?

2008-02-28 Thread Hank Heijink
y time that timer fires is when the run loop is in event tracking mode, which is what I would expect. In the NSDefaultRunLoopMode, that timer doesn't fire at all. Are you doing something somewhere else to make this happen, or am I missing something? Tha

Re: Drawing from secondary thread erases resize corner in window? [solved, for now]

2008-02-28 Thread Hank Heijink
mer to the NSDefaultRunLoopMode though? If I have to chose between having two timers on the main thread that alternate, or one on a secondary thread, I think I'll go with the extra thread. Thanks, Hank Hank Heijink [EMAIL PROTECTED] ___ Cocoa-dev mailing

Re: Drawing from secondary thread erases resize corner in window? [solved, for now]

2008-02-28 Thread Hank Heijink
r or some such thing. By moving the timer to a secondary thread and calling my callback on the main thread that problem is solved. Much simpler and more elegant. Thanks all! Hank Hank Heijink [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Coco

Re: Drawing from secondary thread erases resize corner in window?

2008-02-27 Thread Hank Heijink
On Feb 27, 2008, at 2:40 PM, Hank Heijink wrote: - (void)updateView { if (useSecondaryThread) { if ([view lockFocusIfCanDraw]) { [view drawFromSecondaryThread:view.bounds]; [[view window] flushWindow

Drawing from secondary thread erases resize corner in window?

2008-02-27 Thread Hank Heijink
ead:view.bounds]; [[view window] flushWindow]; [view unlockFocus]; } } else { [view setNeedsDisplay:YES]; } } Thanks for any help! Hank Hank Heijink [EMAIL PROTECTED] ___ Cocoa-d

Re: NSInvocation question

2008-02-27 Thread Hank Heijink
tions that I have no way of predicting. I'm sorry if I'm missing your point. In the meantime, I'll stick to my NSInvocations... Thanks very much for your help! Hank Hank Heijink [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-

Re: NSInvocation question

2008-02-25 Thread Hank Heijink
[setTarget:] followed by -[invoke]. That would mean the target is retained, according to the doc for -[retainArguments]. Hank Heijink [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: NSInvocation question

2008-02-25 Thread Hank Heijink
30 PM, Nir Soffer wrote: Another fix - when your document is closed, release the array holding the MVActions, which retain the invocation. This will break the retain cycle and allow your document to be released. Best Regards, Nir Soffer Hank Heijink [EMAIL PROT

Re: NSInvocation question

2008-02-25 Thread Hank Heijink
On Feb 22, 2008, at 8:47 PM, Chris Suter wrote: On 23/02/2008, at 2:36 AM, Hank Heijink wrote: The nice thing about NSInvocation is not so much its efficiency (or lack thereof, as the case may be), but the fact that once you've got the thing constructed, you can just call invoke

Re: NSInvocation question

2008-02-22 Thread Hank Heijink
ents that I wrapped up in NSInvocations. With IMPs, I have to check the number of arguments both for the typing and for the call. However, even with the check for number of arguments, an IMP is very very fast. Thanks! Hank Hank Heijink [EMAIL PROTECTED]

Re: NSInvocation question

2008-02-21 Thread Hank Heijink
ade NSInvocations because timing is critical and I didn't want to spend the time constructing the call when it needs to be invoked. I haven't profiled the difference yet though, so maybe the tradeof isn't bad. I'll give it a whirl. Thanks! Hank Heijink [EMAIL PROTECTED]

Re: NSMutableArray Problem

2008-02-21 Thread Hank Heijink
ist. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/hank.list %40runbox.com This email sent to [EMAIL PROTECTED] Hank Heijink [EMAIL PROTECTED]