Re: Creating More Than 1 Of The Same Element/control

2013-05-22 Thread Thomas Davie
On 18 May 2013, at 03:21, Harmony Neil wrote: > Hellow, > I've been working through a couple of tutorials and managed to make a text > field and things just fine. The thing I'm wondering is how do I go about > naming the textField what I want to call it, like textField1 or for example > rath

Re: Managing navigation in an iOS app

2013-05-22 Thread Thomas Davie
Hi James, I'd suggest that you're probably pushing the idea of decoupling things a bit too far here. View Controllers are inherantly tied to the behaviour of your application, and your user's experience of the flow through it. In 95% of cases, it's absolutely correct for the view controller t

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-17 Thread Thomas Davie
Alternatively, a dictionary mapping keys onto blocks of type (void(^)(void)), which each compute their result. That, combined with typedef void(^voidBlock)(void); voidBlock constant(id r) { return [^{return r;} copy]; } would give you a dictionary that can store both constants and computed valu

Re: Core Graphics optimisation

2012-08-13 Thread Thomas Davie
On 10 Aug 2012, at 09:09, Fulbert Boussaton <4...@flubb.net> wrote: > Hi everyone, > > on iOS, I was using the following "immediate CG code" to display hundreds > procedural sprites : I'd suggest simply dropping CG, and drawing them using OpenGL ES instead. Thanks Tom Davie _

Re: When does NSInputStream's -getBuffer:length: actually work?

2012-07-25 Thread Thomas Davie
On 25 Jul 2012, at 18:08, Jens Alfke wrote: > NSInputStream has a -getBuffer:length: method that lets you get the available > data from the stream without copying. This is great for performance, and I've > written my client code to take advantage of it if it's supported, but every > time I've

Re: Parser Support

2012-06-18 Thread Thomas Davie
On 18 Jun 2012, at 08:22, Appa Rao Mulpuri wrote: > Hi List, > > Do we have any parser to parse a file with the following entries? > > ID String ID Actual String > 1=STRINGLITERAL_ID_1=String 1 some Blah > 2=STRINGLITERAL_ID_2=String 2 > 3=STRINGLITERAL_ID_3=String 3 > .. > .. > >

Re: Demo Version

2012-06-15 Thread Thomas Davie
On 15 Jun 2012, at 01:06, Preston Sumner wrote: > On Jun 14, 2012, at 11:41 AM, Richard Somers wrote: > >> The Mac App Store guidelines indicates that "Apps that are "beta", "demo", >> "trial", or "test" versions will be rejected". >> >> So if potential customers need to go to my website to do

Re: Dumb Q about console I/O under ObjC

2012-05-27 Thread Thomas Davie
On 27 May 2012, at 18:26, William Squires wrote: > I'm trying to develop my "retro" CRPG game engine as a console app, but how > do I test the input part? I can output to stdio with either printf() or > NSLog, but the debug console only supports output, not input. What's the > normal way to re

Re: Multiple Inheritance

2012-05-24 Thread Thomas Davie
Implement abstract classes that implement the methods, then use the runtime to copy the methods into the classes that should have them in +initialize. Bob On 24 May 2012, at 10:14, Gerriet M. Denkmann wrote: > I have an abstract class M with subclasses MAB, MAX, MXB. > > There are several leng

Re: NSMutableData capacity

2012-05-23 Thread Thomas Davie
On 24 May 2012, at 06:02, Jason Teagle wrote: >>>+dataWithCapacity:some_capacity >> >> The docs note that this doesn't necessarily pre-allocate the given capacity. > > Which is exactly why I said, in the very same sentence, "to guarantee it has > the capacity (but not necessarily allocated

Drawing unicode glpyhs

2012-05-03 Thread Thomas Davie
Hi all, I'm having an issue with drawing text via CGContextShowGlyphs, whereby it doesn't draw cyrilic (and presumably a variety of other exciting) characters. The code at https://github.com/beelsebob/OpenStreetPad/blob/master/OpenStreetPad/OSPMetaTileView.m#L710 (which goes via CTLineDraw) su

Re: WWDC

2012-04-25 Thread Thomas Davie
Do you have a bug number that I could reference? I'd probably like to file one asking them to do *several* WWDCs around the world – the cost to people in the bay area is already pretty high ($1.6k ish per attendee), but to someone in the UK, the cost is more like $4k per attendee. Plus of cour

Re: @-directives

2012-03-08 Thread Thomas Davie
Not that I know of off the top of my head, but here's my attempt at such a list: @class @interface @implementation @end @private @public @protected @protocol @required @optional @property @synthesize @try @catch @finally @autoreleasepool @synchronized Have I missed your favourite out? Bob if (*r

Re: [ANN] CoreParse (Version n+1)

2012-03-05 Thread Thomas Davie
I'm pretty sure I did this the first time I announced CoreParse too >.< Thanks for the suggestion Uli: https://github.com/beelsebob/CoreParse Tom Davie if (*ra4 != 0xffc78948) { return false; } On 5 Mar 2012, at 13:45, Uli Kusterer wrote: > On 05.03.2012, at 12:09, Thomas Dav

[ANN] CoreParse (Version n+1)

2012-03-05 Thread Thomas Davie
Hi All, A while ago I showed you all my parsing library 'CoreParse', and got some really useful feedback. Today, I'd like to show you what's changed since then! • Easier processing of syntax trees into your data structures. In earlier versions of CoreParse you had to use a parser delegate t

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-25 Thread Thomas Davie
To me, it breaks one of my golden rules, and exposes one of the things I dislike about C. Expressions, at least in my mind, should not involve state change – that's what statements are for. My rationale behind this is that it makes it easier to read expressions – you get one more guarantee abo

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-24 Thread Thomas Davie
Neither is more correct. The main distinction is whether you are happy with C's (very weak) type system or not. If you are satisfied that if simply checks if some integer typed value is equal to 0 or not, and uses the first branch if it isn't, then the former is more concise and "better" for y

Re: How to parse multipart/form-data?

2012-01-29 Thread Thomas Davie
CoreParse! https://github.com/beelsebob/CoreParse I hope that helps :) Thanks Tom Davie if (*ra4 != 0xffc78948) { return false; } On 28 Jan 2012, at 06:29, Kai Cao wrote: > Hi, > > I'm using CocoaHTTPServer to upload files from computer to iOS devices. But > the result NSData received from

Re: NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Thomas Davie
On 22 Jan 2012, at 18:45, Jens Alfke wrote: > > On Jan 22, 2012, at 5:15 AM, Thomas Davie wrote: > >> As you can see, none of that is in my code (beyond main), so I have a real >> problem debugging what's going on here. > > Cocoa debugging tip: A crash in ob

Re: NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Thomas Davie
Thanks Andreas, I am indeed using ARC, so the code should be safe enough, as ARC will retain rec for me. Cheers for taking a look though Tom Davie if (*ra4 != 0xffc78948) { return false; } On 22 Jan 2012, at 13:35, Andreas Grosam wrote: > > On Jan 22, 2012, at 2:15 PM, Thomas Davie

NSXMLParser, streams, multiple threads, and crashing

2012-01-22 Thread Thomas Davie
Hi all, I'm having a bit of a bizarre issue with a pair of NSXMLParsers reading out of streams, where my main thread crashes while signalling a stream. Every crash occurs in the main thread, with this back trace: > #00x0175d0b0 in objc_msgSend () > #10x0133fb4d in _outputStreamCallbackFu

Re: Calling a Cocoa library from C

2011-11-12 Thread Thomas Davie
Note that of course you can take this one step further and use a typedef to mask that you're passing back an untyped pointer: typedef OCObjcCodeRef void * OCObjcCodeRef OCCreateObjcCode(void) { return (ObjcCodeRef)[[ObjcCode alloc] init] } int OCGetFloatData(OCObjcCodeRef objcCodeRef, float

Re: Calling a Cocoa library from C

2011-11-12 Thread Thomas Davie
On 12 Nov 2011, at 18:45, Nathan Sims wrote: > On Nov 11, 2011, at 6:22 PM, Wim Lewis wrote: > >> int get_float_data(float *result1, float *result2) >> { >> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; >> @try { >> [objcCode call]; >> *result1 = [more stuff]; >> etc.; >> } @catc

Re: C struct and __unsafe_unretained

2011-10-30 Thread Thomas Davie
Yes and no – it means you have an NSString there that can disappear at any moment without warning, and when it does, you'll still have a pointer into garbage memory. Also, if the original code has been copying/retaining it into the struct and releasing it out, then it's entirely possible that b

Animating a UITableViewCell changing size

2011-10-13 Thread Thomas Davie
Dear list, I'm trying to construct a UITableViewCell with what is essentially a disclosure triangle on it. When that's tapped, the cell expands to show additional information. I currently hack this with code along these lines: NSArray *cellPaths = [tableView indexPathsForVisibleRows];

Re: How to blink with a focus ring of the text box?

2011-10-06 Thread Thomas Davie
The correct way to notify a user that he can't enter text in a text box is to disabled it. Bob if (*ra4 != 0xffc78948) { return false; } On 6 Oct 2011, at 16:33, Nick wrote: > Hello > I am wondering if there's a way to do this, notifying the user that he can't > enter any more text into NSTextF

Re: adding something to a setter

2011-10-06 Thread Thomas Davie
On 6 Oct 2011, at 14:16, Torsten Curdt wrote: > Hm... using KVO for an object to observe it's own properties? > That's feels wrong to me. > Is that just me? No, definitely not just you... But then, I find KVO pretty wrong in the first place. if (*ra4 != 0xffc78948) { return false; } _

Re: adding something to a setter

2011-10-06 Thread Thomas Davie
On 6 Oct 2011, at 13:36, Mike Abdullah wrote: > > On 6 Oct 2011, at 13:09, Thomas Davie wrote: > >> >> Does anyone have any comments on why that might not work, before I file a >> bug report to request it? > > Well it would become rather unreadable for anyth

Re: adding something to a setter

2011-10-06 Thread Thomas Davie
I don't know of any better way than simply writing the setters yourself. One thing I'd love to see apple add to the language is allowing us to specify a code block to be included in setter and getting in the synthesize: @property (readwrite, retain, nonatomic) NSString *theValue; @synthesize (

Re: creating multiple NSTimers

2011-09-30 Thread Thomas Davie
On 30 Sep 2011, at 08:19, Conrad Shultz wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 9/29/11 10:50 PM, Greg Guerin wrote: >> Gordon Apple wrote: >> >>> There must already be an array for the table, so just iterate >>> the >> array every >>> minute or whatever (single repeating

Re: Cleaning up a window with blocks

2011-09-29 Thread Thomas Davie
A quick scan over the code says that your issue is that you're referring to theObserver inside theObserver, which, when the block is constructed, as not yet been assigned the result of addObserverForName:... Bob if (*ra4 != 0xffc78948) { return false; } On 29 Sep 2011, at 17:37, Eric Gorr wrote

Re: nonatomic vs atomic assign/retain

2011-09-06 Thread Thomas Davie
There are two schools of thought on atomic/nonatomic, and both apply equally to Mac/iOS: 1) Atomicity provides a little bit of safety, and shouldn't be shrugged off for no reason. Because of that, only optimise the atomic set/get when you've actually profiled and determined it's a problem. 2)

Re: Overwhelming Options

2011-09-01 Thread Thomas Davie
Can I ask what your app is? I find it hard to believe that your user really needs to set 42 boolean flags. There must surely a better way to think about the configuration. Tom Davie if (*ra4 != 0xffc78948) { return false; } On 1 Sep 2011, at 17:36, Jeremy Matthews wrote: > I have an app with

Re: ARC + CF types

2011-08-31 Thread Thomas Davie
On 31 Aug 2011, at 21:55, Clark Cox wrote: > On Mon, Aug 29, 2011 at 7:20 AM, Thomas Davie wrote: >> I'm not really very clear on how ARC and CF types are meant to interact yet, >> because of that I've managed to create some buggy code, could someone have a >>

Re: ARC + CF types

2011-08-29 Thread Thomas Davie
tter is a policy decision. > > davez > > > On Aug 29, 2011, at 7:37 AM, Thomas Davie wrote: > >> Because NSMutableSet does not have the ability to specify a different >> version of equality – though as Mike Ash pointed out in #macdev, NSHashTable >> may well be app

Re: ARC + CF types

2011-08-29 Thread Thomas Davie
Because NSMutableSet does not have the ability to specify a different version of equality – though as Mike Ash pointed out in #macdev, NSHashTable may well be appropriate. Thanks Thomas if (*ra4 != 0xffc78948) { return false; } ___ Cocoa-dev mailing

ARC + CF types

2011-08-29 Thread Thomas Davie
I'm not really very clear on how ARC and CF types are meant to interact yet, because of that I've managed to create some buggy code, could someone have a quick stare at this and tell me what I've misunderstood that's causing a segfault when adding to the mutable set: https://gist.github.com/117

Re: Large over 100K pixel high ruler scroll view

2011-08-23 Thread Thomas Davie
if (*ra4 != 0xffc78948) { return false; } On 23 Aug 2011, at 22:18, Julie Porter wrote: > I work with scans of 10 tune Nickelodeon player piano rolls. These can be > over 100 yards long when unrolled. My roll images when uncompressed can be > 100,000 plus pixels by 2800 pixels. In actual pra

Re: Asynchronous downloading and parsing of XML

2011-08-08 Thread Thomas Davie
On 8 Aug 2011, at 18:16, Mikkel Islay wrote: > On 8 Aug 2011, at 19:04, Thomas Davie wrote: >> >> Parameters >> stream >> The input stream. The content is incrementally loaded from the specified >> stream and parsed. > > No, that states something about th

Re: Asynchronous downloading and parsing of XML

2011-08-08 Thread Thomas Davie
The hint is that the NSXMLParser docs say: Parameters stream The input stream. The content is incrementally loaded from the specified stream and parsed. if (*ra4 != 0xffc78948) { return false; } On 8 Aug 2011, at 17:59, Mikkel Islay wrote: > Thanks for the explanation, Jens too. > The hint tha

Re: Coordinate system in CAOpenGLLayer

2011-08-08 Thread Thomas Davie
You're right – the vertices are here specified in OpenGL "clip space" – a coordinate system stretching from -1 to 1 on all 3 axes. If you want to specify points in a different coordinate space, it's your responsibility to make sure that they end up in clip space, by transforming them appropriat

Re: Asynchronous downloading and parsing of XML

2011-08-07 Thread Thomas Davie
and make sure errors are propagated up > and down the stream. > > Mikkel > > > On 6 Aug 2011, at 22:08, Thomas Davie wrote: > >> Just for reference, With the help of Mike Ash I figured out how to do this >> sensibly. Note, code typed straight into Mail.app, so i

Re: Asynchronous downloading and parsing of XML

2011-08-06 Thread Thomas Davie
u feed to NSXMLParser is complete. > > Mikkel > > On 6 Aug 2011, at 12:02, Thomas Davie wrote: > >> >> I'm trying to figure out how to download and parse XML at the same time. >> NSXMLParser seems to have support for this by providing it with an >>

Asynchronous downloading and parsing of XML

2011-08-06 Thread Thomas Davie
Hi everyone, I'm trying to figure out how to download and parse XML at the same time. NSXMLParser seems to have support for this by providing it with an NSInputStream. However, I see no way to get an NSInputStream that contains the data that an NSURLConnection is downloading. Is this possibl

Re: Drawing text like Lion's Mail

2011-08-03 Thread Thomas Davie
On 3 Aug 2011, at 22:40, Andre Masse wrote: > One less pass is good. Thanks. > > Unfortunately, text is not as clean as Mail at this point. Small characters > like "e" loose sharpness (white space inside the character is reduced). Still > trying to find a winner by mixing different values. I'm

Re: Unnecessary Boolean Warning

2011-08-03 Thread Thomas Davie
On 3 Aug 2011, at 15:15, Scott Ribe wrote: > On Aug 3, 2011, at 7:54 AM, Thomas Davie wrote: > >> Not really – both C ands are the same and… they're just operating on >> different representations of booleans. > > No, they're not the same at all. One is a bitw

Re: Unnecessary Boolean Warning

2011-08-03 Thread Thomas Davie
On 3 Aug 2011, at 14:29, Scott Ribe wrote: > On Aug 3, 2011, at 1:53 AM, Dale Miller wrote: > >> A decent language (IMHO) would not confuse things with two different "and's". > > Well, there *are* two different and's, regardless of whether your favored > languages allow you access to both or n

Re: ARC and Singletons

2011-08-01 Thread Thomas Davie
On 1 Aug 2011, at 16:48, Jeff Kelley wrote: > Is there a new recommended way to implement a singleton with ARC? I remember > hearing something about it, but I’m not sure what it was. Was it perhaps… don't use singletons, they're just globals in disguise? Bob_

Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?

2011-07-30 Thread Thomas Davie
On 29 Jul 2011, at 23:54, wadesli...@mac.com wrote: >> When invoking -archivedDataWithRootObject: on, say, dictionary, finding an >> un-encodeable object buried somewhere in the dictionary would seem to be >> quite common. Similarly, when invoking -unarchiveObjectWithFile:, no >> programmer c

Re: Calculations in a tableview

2011-07-28 Thread Thomas Davie
On 28 Jul 2011, at 23:48, Andre Masse wrote: > Hi, > > For example, lets say I have a tableview with 3 columns: quantity, unit price > and total. I want to calculate total using (quantity * unit price). Pretty > simple using a datasource but I've no idea how to do that with bindings > (using

Re: UI like Transmission BT

2011-07-28 Thread Thomas Davie
On 28 Jul 2011, at 09:16, Wilker wrote: > Hi Guys, > > Which components of XCode 4 I should use in order to make an UI like the > Transmission BT (http://www.transmissionbt.com/) > > I mean the part of downloads, one below the other, its like each download is > a view, but I don't know how to p

Re: iOS UI Design Question / Opinions wanted

2011-07-14 Thread Thomas Davie
On 14 Jul 2011, at 06:05, John Tsombakos wrote: > Hi, > > Just getting more into iOS development, and am deciding on what to do for an > app. One app is a "competition scoring" application, where the judges would > use the app to calculate and score a game. The scores would are derived from > a

Re: Removing (foo) from a NSString

2011-07-12 Thread Thomas Davie
On 12 Jul 2011, at 20:23, Eric E. Dolecki wrote: > What would be the easiest way to strip out parens and everything between > them from an NSString? It's slightly overkill for the situation, but CoreParse (http://www.github.org/beelsebob) will deal with nested parens quite happily.

Re: [ANN] CoreParse

2011-06-26 Thread Thomas Davie
On 6 Jun 2011, at 16:10, Philip Mötteli wrote: > I really appreciate how BN support is implemented in ParseKit: > . I like it very much, that there are no > numbers, but call backs for every token, using method-names (c. f. above URL > under "Instantiating Gr

Re: [ANN] CoreParse

2011-06-06 Thread Thomas Davie
On 6 Jun 2011, at 16:10, Philip Mötteli wrote: > Hi, > > > Am 06.06.2011 um 00:12 schrieb Thomas Davie: >> On 5 Jun 2011, at 18:22, Jens Alfke wrote: >> On Jun 5, 2011, at 6:21 AM, Thomas Davie wrote: >>> >>>> I've just completed

Re: [ANN] CoreParse

2011-06-06 Thread Thomas Davie
On 5 Jun 2011, at 15:35, Stephane Sudre wrote: > Hi, > > your post probably misses the following stuff: > > - a URL > - the license > - whether it's written in Obj-C 2.0 (which I personally hope it's not) or 1.0. That'll teach me for posting this just as I was going out the door! - URL - htt

Re: [ANN] CoreParse

2011-06-05 Thread Thomas Davie
On 5 Jun 2011, at 18:22, Jens Alfke wrote: > > On Jun 5, 2011, at 6:21 AM, Thomas Davie wrote: > >> I've just completed firming up the API and documentation for CoreParse. >> CoreParse provides a powerful tokenisation and parsing engine, which uses >> shift

[ANN] CoreParse

2011-06-05 Thread Thomas Davie
Hi guys, I guess this will get rather overshadowed by some other guy's announcements in the near future, but I thought I'd throw this out there. I've just completed firming up the API and documentation for CoreParse. CoreParse provides a powerful tokenisation and parsing engine, which uses sh

Re: Set the Display link's framerate?

2011-05-08 Thread Thomas Davie
On 8 May 2011, at 20:20, Nick wrote: > Hi > Is there any way to customize the frequency of the Core Video Display > Link's callback calls? > If not, what is the way to manually limit the "framerate"? The entire point of a CVDisplayLink is that it's tied to the refresh timing of the display. If

Re: Documentation generation

2011-05-08 Thread Thomas Davie
ave > > Sent from my iPhone > > On May 8, 2011, at 4:42 AM, Thomas Davie wrote: > >> Heya, >> >> I'm working on improving my CoreParse >> (http://www.github.com/beelsebob/CoreParse) framework by actually >> documenting it properly. The pr

Documentation generation

2011-05-08 Thread Thomas Davie
Heya, I'm working on improving my CoreParse (http://www.github.com/beelsebob/CoreParse) framework by actually documenting it properly. The problem I'm hitting though is that either the two major documentation generators suck (doubt that, probably PEBKAC), or their default configuration sucks.

Online NSPrinters

2011-05-02 Thread Thomas Davie
Heya, The NSPrinter documentation says it will return nil of the specified printer passed to +printerWithName: is not available. Apparently being "available" does not correspond to being "online" as listed in System Preferences. Is there a sane way to check if a printer is connected and ready

Re: NSOpenPanel

2011-04-25 Thread Thomas Davie
On 25 Apr 2011, at 12:55, Rick C. wrote: > Hello, > > I'm thinking the answer is no but just to double-check is there any way to > get another button into an NSOpenPanel? I only see the possibility for the > default and cancel buttons unless I'm overlooking something. Thanks! See -setAccess

Re: A very customized window

2011-04-16 Thread Thomas Davie
On 16 Apr 2011, at 13:44, eveningnick eveningnick wrote: > Basically i need this, to make my application look as similar as > possible to my Windows version. A truely terrible idea! Why on earth do you think Mac users use Macs? Don't you think if they wanted everything to look and behave like

Re: Trying to subclass UISwitch

2011-04-05 Thread Thomas Davie
On 4 Apr 2011, at 17:31, Philip Ershler wrote: > Outstanding, thank you very much! > > Phil > > On Apr 4, 2011, at 10:28 AM, Roger Dalal wrote: > >> Phil: >> >> Try http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and Robert >> Chin. It is well done. >> >> Roger Dalal >> Assembled

Re: @property and Garbage Collection

2011-01-25 Thread Thomas Davie
On 25 Jan 2011, at 09:59, Kevin Bracey wrote: > Hi Guys, > > I've been using Retain/Release up til now but I have started my first GC > project. > > In a Garbage Collected App when using the @property is it correct that I > still have to specify (copy) or (retain) or have I missed something?

Re: NSNotFound

2011-01-15 Thread Thomas Davie
On 15 Jan 2011, at 18:43, Richard Somers wrote: > NSNotFound is formally defined as NSIntegerMax. But the framework methods > returning NSNotFound are typically typed NSUInteger. > > Is there a technical reason why NSNotFound is not defined as NSUIntegerMax? 1) Because it's usable for NSIntege

Locating a contextual menu

2011-01-09 Thread Thomas Davie
Heya, I'd like in my app to be able to position an item by right clicking, and selecting something from a contextual menu. I'm struggling with this though, I don't see any way to find the position of the click that caused the contextual menu to appear. Things I've tried: 1) using standard res

Re: Responding to the keyboard in an NSCell

2010-11-25 Thread Thomas Davie
On 25 Nov 2010, at 11:30, Graham Cox wrote: > > On 25/11/2010, at 10:12 PM, Thomas Davie wrote: > >> Surely in order to defer control though there would have to be some protocol >> defined somewhere that tells us how a view can ask a cell for help in >> responding

Re: Responding to the keyboard in an NSCell

2010-11-25 Thread Thomas Davie
On 25 Nov 2010, at 10:46, Graham Cox wrote: > > On 25/11/2010, at 9:37 PM, Thomas Davie wrote: > >> I'm trying to implement an NSCell which should be able to respond to the >> user pressing backspace to delete something, but I don't quite see how >> key

Responding to the keyboard in an NSCell

2010-11-25 Thread Thomas Davie
I'm trying to implement an NSCell which should be able to respond to the user pressing backspace to delete something, but I don't quite see how keyboard handling is meant to work. The - (BOOL)acceptsFirstResponder method seems to suggest that NSCell *should* be an NSResponder subclass. It isn'

Asking an outline/table view to send it's setObjectValue:... message

2010-11-22 Thread Thomas Davie
Hi, I'm writing a custom cell at the moment that's used in an outline view, it's object value changes sometimes when the outline view doesn't expect it to (which seems to be only on mouse down or end editing). Is there some way I can force the outline view to send it's - (void)outlineView:(NSO

Re: On self = [super init...] ...

2010-11-18 Thread Thomas Davie
On 18 Nov 2010, at 21:16, Bill Bumgarner wrote: > > On Nov 18, 2010, at 1:10 PM, John Engelhart wrote: > >> The basic premise behind self = [super init...] is that the "lower levels of >> initialization are free to return a different object than the one passed in". >> >> However, there is an

Re: How to remove 'not found in protocol' compiler warning

2010-11-12 Thread Thomas Davie
On 12 Nov 2010, at 14:17, Sherm Pendley wrote: > On Fri, Nov 12, 2010 at 9:09 AM, Paul Johnson wrote: > >> I'm getting a compiler warning message at the following line of code: >> >> NSArray *selectedObjects = [[secondTableView dataSource] >> selectedObjects]; >> >> The warning message is <

Re: iPad 4.1 (deploy to 3.2.2) error

2010-11-11 Thread Thomas Davie
On 11 Nov 2010, at 14:50, Steve Bird wrote: > > On Nov 11, 2010, at 9:39 AM, colors wrote: > >> Wow I am so sorry I posted to this forum. I thought this was a forum for >> engineers, but turns out everyone on it is a lawyer. >> >> I fat fingered a 2 instead of a 1 in the subject field and en

Re: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Thomas Davie
On 23 Sep 2010, at 07:39, Tito Ciuro wrote: > Hm. That would be discussed better on a White Paper or similar. There are > countless tutorials and documents about Core Data already. What I can do > however is to provide a small example to illustrate how NanoStore works. > > I believe (please co

Re: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-22 Thread Thomas Davie
On 23 Sep 2010, at 03:51, Tito Ciuro wrote: > > Today, Webbo is pleased to announce the release of NanoStore: > > http://sourceforge.net/projects/nanostore/ > > NanoStore is a Cocoa wrapper for SQLite, a C library that implements an > embeddable SQL database engine. > > With NanoStore, you st

Re: Core Graphics wants 10 petabytes of RAM

2010-09-07 Thread Thomas Davie
On 7 Sep 2010, at 13:10, Guillem Palou wrote: > > On Sep 7, 2010, at 2:07 PM, Thomas Davie wrote: > >> I'm having a problem with CoreGraphics periodically deciding it wants to >> allocate an enormous amount of RAM, the code in question is simply trying to >>

Core Graphics wants 10 petabytes of RAM

2010-09-07 Thread Thomas Davie
I'm having a problem with CoreGraphics periodically deciding it wants to allocate an enormous amount of RAM, the code in question is simply trying to create an NSImage from raw data: CGContextRef context = CGBitmapContextCreate(imgData, width,

Re: NSOpenPanel -setAllowedFileTypes

2010-08-26 Thread Thomas Davie
On 26 Aug 2010, at 18:41, k...@highrolls.net wrote: > I have an accessory view in an NSOpenPanel which contains a NSComboBox. The > combo box is a list of file extensions. When the user selects an entry the > action method calls --setAllowedFileTypes. All these mechanics work properly. > The

Re: Garbage collector

2010-06-08 Thread Thomas Davie
At present, the iPhone SDK does not support garbage collection, so you're best off at least making it GC supported, rather than required. Bob On 8 Jun 2010, at 11:48, Takeichi Kanzaki Cabrera wrote: > Hi all, I'm beginning with an application for Mac OS X that in a > future could become into an

Re: -[NSMutableSet randomObject]

2010-05-25 Thread Thomas Davie
If this is indeed the desired effect, you're much better off writing a - (NSArray *)arrayByRandomlyOrderingObjects in an NSArray category, and then calling [[mySet allObjects] arrayByRandomlyOrderingObjects];. Bob On 25 May 2010, at 17:54, Dave DeLong wrote: > Ah, I see; you don't want to pro

Re: Regarding MVC design pattern

2010-05-20 Thread Thomas Davie
On 20 May 2010, at 15:45, Barry Skidmore wrote: > If you need to have it set you should create an initWithOptionName: and call > that from your standard init, or return an error stating a missing value is > needed. > > Your init should always call down tithe most specific init. > > Specific e

Re: Regarding MVC design pattern

2010-05-20 Thread Thomas Davie
On 20 May 2010, at 15:24, mmalc Crawford wrote: > > On May 19, 2010, at 4:38 am, Sherm Pendley wrote: > >> If you set the ivars directly, as above, the synthesized setters will >> NOT be called. For that to happen, you need to use dot-syntax, like >> this: >> >> - (void) dealloc { >> self.be

Re: iPhone: viewDidAppear called, Default.png still visible

2010-05-14 Thread Thomas Davie
On 12 May 2010, at 17:54, sebi wrote: > Hello, > > How can I find out if my first view is up and running? When viewDidAppear is > called on my fist UIViewController I'm still looking only at the Default.png. > > What I do first in my app is: > 1. wait for viewDidAppear to be called > 2. show s

Re: [iPhone] How to create a unique string

2010-05-13 Thread Thomas Davie
On 13 May 2010, at 15:33, Eric Gorr wrote: > So long as it is ok for the string to be unique for the network the user is > on only. From the docs: > > The ID includes the host name, process ID, and a time stamp, which ensures > that the ID is unique for the network. > > A UUID (Universally Un

Re: self = [super init], nil?

2010-05-10 Thread Thomas Davie
On 10 May 2010, at 16:49, Thomas Wetmore wrote: > This is the initializer pattern I settled on a few years back: > > - (id) init... > { >if (!(self = [super init])) return nil; >... >return self; > } > > Trillions of calls later I can report upon its serviceability. > > I come from

Re: premultiplying alpha

2010-05-05 Thread Thomas Davie
On 5 May 2010, at 06:05, Ken Ferry wrote: > > On Tue, May 4, 2010 at 9:30 AM, David Duncan wrote: > On May 4, 2010, at 8:57 AM, Thomas Davie wrote: > > > After much searching about, I discovered (contrary to what the docs say), > > that NSBitmapImageReps do not always

premultiplying alpha

2010-05-04 Thread Thomas Davie
After much searching about, I discovered (contrary to what the docs say), that NSBitmapImageReps do not always premultiply their r/g/b by their alpha. Because of this, I've dived in, and attempted to write my own premultiplication, but something is going very wrong. Some images are coming out

Re: Nil items in NSMutableSet

2010-03-16 Thread Thomas Davie
> Your code doesn't account for the possibility that the order of > comparison might happen in the other order (i.e. [@"123" isEqual: > object]). I wouldn't be surprised if NSSet is assuming that equality > is transitive (i.e. [a isEqual: b] == [b isEqual: a]). For reference, this property is not

Re: Anything like -[performBlockOnMainThread:]?

2010-03-15 Thread Thomas Davie
Just for reference's sake: @interface NSObject (BlockOnMainThread) - (void)performBlockOnMainThread:(void(^block)()); @end @interface NSObject (BlockOnMainThreadPrivate) - (void)performBlock:(void(^block)()); @end @implementation NSObject (BlockOnMainThread) - (void)performBlockOnMainThread

Re: Which iPhone Program?

2010-03-13 Thread Thomas Davie
On 13 Mar 2010, at 16:41, Alexander Spohr wrote: > > Am 13.03.2010 um 17:03 schrieb Thomas Davie: > >> On 13 Mar 2010, at 11:59, Alexander Spohr wrote: >> >>> This is not really a Cocoa question... >>> >>> - If you want your application in the

Re: Which iPhone Program?

2010-03-13 Thread Thomas Davie
On 13 Mar 2010, at 11:59, Alexander Spohr wrote: > This is not really a Cocoa question... > > - If you want your application in the store you need Company. This is not true, I currently have two applications in the store, and do not have a company account. The important difference is that if

Re: EXC_BAD_ACCESS

2010-03-11 Thread Thomas Davie
Oops, sorry, my dealloc was buggy o.O - (void)dealloc { [path release]; [super dealloc]; } Bob On 11 Mar 2010, at 13:38, Billy Flatman wrote: > Hi All, > > I'm getting a 'EXC_BAD_ACCESS' error when calling the fill on a NSBezierPath. > Below is an outline of my code. > > > @interface Sha

Re: EXC_BAD_ACCESS

2010-03-11 Thread Thomas Davie
Your initBezierPath method reallocates and reinitialises a path that's already been created. It also autoreleases the result (as the allocation method doesn't start with alloc, copy, mutableCopy, retain or new). The result is that the first time 'path' is assigned it gets a non-released value.

Re: NSCollectionView deselection

2010-03-02 Thread Thomas Davie
On 2 Mar 2010, at 04:03, Markus Spoettl wrote: > On Mar 1, 2010, at 2:42 PM, Thomas Davie wrote: >> However, when the user clicks on item B after clicking on item A, >> setSelected:NO is *not* sent to the NSCollectienViewItem subclass for A. >> This displeases me grea

Re: NSCollectionView deselection

2010-03-02 Thread Thomas Davie
On 2 Mar 2010, at 14:39, Markus Spoettl wrote: > On Mar 2, 2010, at 3:36 AM, Thomas Davie wrote: >>> On Mar 1, 2010, at 2:42 PM, Thomas Davie wrote: >>>> However, when the user clicks on item B after clicking on item A, >>>> setSelected:NO is *not* sent to t

NSCollectionView deselection

2010-03-01 Thread Thomas Davie
Hi, I have, after much struggling with the documentation, managed to create an NSCollectionView that displays all the items I want it to. However, selection isn't quite working right. When the user clicks on item A, setSelected:YES is sent to the NSCollectionViewItem subclass for A. This ple

Re: Dynamically loading a part of a Window in Cocoa

2009-07-01 Thread Thomas Davie
On 1 Jul 2009, at 09:21, Debajit Adhikary wrote: I have an area of a Window (in my MainMenu.xib) which I'd like to populate dynamically with unrelated "views" such as an NSTable, IKImageBrowserView etc. at different points of time depending on some user-selected criteria. - How do I de

Re: Dispose patern (was: Re: GC pros and cons)

2009-06-28 Thread Thomas Davie
On 28 Jun 2009, at 19:27, Stephen J. Butler wrote: On Sun, Jun 28, 2009 at 11:06 AM, Thomas Davie wrote: On 28 Jun 2009, at 17:47, Konrad Neitzel wrote: I still have to read much more about the GC used within Objective- C / Cocoa so I am not sure, if I am not writing some kind of

  1   2   >