OS X Game Programming

2010-04-07 Thread Pascal Harris
I've never programmed games before, although I've got a fair bit of useful OS X 
utility software under my belt.  I've now had a few ideas that I'd like to 
implement - and I'm stuck at almost the first hurdle.  I've managed to create 
an OpenGL view (by way of experimentation) and chuck a few graphics into it 
(triangles, circles (well, the closest OpenGL can get to a circle anyway!) and 
so forth).  But I can't work out how to get that OpenGL view to accept 
keystrokes from my event loop.  When it comes to tile based games I'm at a 
complete loss.

Obviously, there are various resources out there (SDL, Blitz etc), but I'd 
rather not use those because I want to understand the ins and outs of my 
engine.  I've googled and come up with plenty of resources for Windows game 
programming - but not so many for the Mac.  In fact, the only book that 
approaches what I'm after (with friendly examples) is "Pangea Software’s 
Ultimate Game Programming Guide for Mac OS X" - but that's rather out of date.

What I really want is something like the excellent guides written by luminaries 
like Kochan or  Hillegass, but focussed on game programming for OS X.  Does 
anyone know if such a guide exists?  Failing that, is anyone able to suggest a 
noddy guide to programming games that I might be able to find on the 'net 
(because so far my efforts have been rather below par).

Sorry to post such a non-technical question - I didn't know who else to 
ask.___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Using Core Data ManagedObjectIDs to uniquely name files

2010-04-07 Thread Ken Tabb

Hi Gideon,

thanks for taking the time to reply. I see your point, if there were  
more than 1 store being opened, but only 1 folder location for mugshot  
files, then assuming that each 1st Employee would have the objectID:


x-coredata://.../Employee/p101

... then if I'm only using the p101 part, all my employees across  
stores will start looking alike :)


As Sean just suggested, I was considering eventually making it all a  
package (the non-document store and "mugshots" subdirectory all in 1  
nice opaque file package) with the Employee deriving the location of  
mugshot files relative to the location on disk of the store. So  
hopefully that'd give each store it's own images folder, and the job's  
a good 'un.


I think though, as you say, I'll use UUIDs just in case Core Data  
evolves and (due to my own dependency on shifting sands) corrupts my  
perceived data integrity. Or rather, highlights the lack of data  
integrity caused by my assumptions :)


Thanks again,
Ken

On 6 Apr 2010, at 1:18, Gideon King wrote:


Hi Ken

If someone created another copy of your database, I imagine the last  
path component could be duplicated, since it would not know about  
the other copy and create the same primary key.


I believe that the URI is made up of the store id / entity /  
reference object. With a document based application, the store id  
changes when you do a save as, but I presume a non-document based  
app would remain constant.


I entity related changes are identified in the metadata via a hash,  
and I don't think they would affect the URI, but I haven't had cause  
to check that.


Another option for naming your files may be based on a UUID you  
store in your data, or perhaps something like a SHA1 hash of the  
file, which would also let you know if the file had changed, if that  
was of interest to you.


HTH

Gideon

On 06/04/2010, at 9:27 PM, Ken Tabb wrote:


My questions are:

[1] Presuming that my Employee objects all have permanent  
objectIDs, can I rely upon using myEmployee] objectID]  
URIRepresentation] lastPathComponent] as a unique filename for that  
object? i.e. so that I end up with p101.tiff, p102.tiff images.


[2] Is an object's permanent ID truly permanent (for that saved  
object, in that store, on that app, on that machine), or might it  
get changed when an app's managed model gets modified (eg. when I  
start making Company entities too, or if I add a 'shoesize'  
attribute to an Employee) or during a future version of Core Data?


[3] Are the SQLite-based objectIDs similarly easy to get to the  
unique bit (and similarly can I rely upon always being able to use  
them)?


Or is there a better way of doing what I'm trying to do? The docs  
seem rather thin on the ground in terms of permitted (read-only)  
uses of the objectID, besides testing for equality, and for  
permanence. As I say, the app is working fine at the moment (on a  
development release XML store), but I just want to check if I'm  
making safe assumptions as it feels almost as dirty and sneaky as  
playing with private APIs, and I'd rather not base a shipping app  
on something just because it happens to work right now for me on my  
machine :)


As ever, thanks in advance for any help you can give,
Ken





- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Jean-Daniel Dupas
Most basics OpenGL sample codes on ADC handle keyboard events.

For instance, first Google result for "Cocoa OpenGL"

http://developer.apple.com/mac/library/samplecode/CocoaGL/Introduction/Intro.html


Le 7 avr. 2010 à 09:34, Pascal Harris a écrit :

> I've never programmed games before, although I've got a fair bit of useful OS 
> X utility software under my belt.  I've now had a few ideas that I'd like to 
> implement - and I'm stuck at almost the first hurdle.  I've managed to create 
> an OpenGL view (by way of experimentation) and chuck a few graphics into it 
> (triangles, circles (well, the closest OpenGL can get to a circle anyway!) 
> and so forth).  But I can't work out how to get that OpenGL view to accept 
> keystrokes from my event loop.  When it comes to tile based games I'm at a 
> complete loss.
> 
> Obviously, there are various resources out there (SDL, Blitz etc), but I'd 
> rather not use those because I want to understand the ins and outs of my 
> engine.  I've googled and come up with plenty of resources for Windows game 
> programming - but not so many for the Mac.  In fact, the only book that 
> approaches what I'm after (with friendly examples) is "Pangea Software’s 
> Ultimate Game Programming Guide for Mac OS X" - but that's rather out of date.
> 
> What I really want is something like the excellent guides written by 
> luminaries like Kochan or  Hillegass, but focussed on game programming for OS 
> X.  Does anyone know if such a guide exists?  Failing that, is anyone able to 
> suggest a noddy guide to programming games that I might be able to find on 
> the 'net (because so far my efforts have been rather below par).
> 
> Sorry to post such a non-technical question - I didn't know who else to 
> ask.___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org
> 
> This email sent to devli...@shadowlab.org

-- Jean-Daniel




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread patrick machielse
Op 6 apr 2010, om 17:22 heeft cocoa-dev-requ...@lists.apple.com het volgende 
geschreven:

> I've been searching google for a while, and have repeatedly stumbled across 
> mention of an Objective-C ID3 framework constantly linked to
> 
> http://drewfamily.homemail.com.au/Cocoa_-_ID3Tag_framework.html

Don't use that, it is no longer up to date. It was a valiant attempt at ID3 
support, but it doesn't adhere to the ID3 specifications very well and it 
stumbles on real world tags more often than other solutions do.

I can recommend TagLib:
http://developer.kde.org/~wheeler/taglib.html

It uses a C++ API, but it is quite easy to use. Rolling it into a OS X 
framework is easy (Google it). TagLib adheres strictly to the ID3 standard but 
by default it uses workarounds for the instances when iTunes doesn't... It is 
also very stable, actively developed, it's covered by a usable license (lgpl), 
supports more tags than just ID3, and there's a development mailing list. What 
more do you want?

patrick
--
Patrick Machielse
Hieper Software

http://www.hieper.nl
i...@hieper.nl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Wondering about that iPad page curling

2010-04-07 Thread Tito Ciuro
How about this example? You can download the source as well:

http://www.devx.com/wireless/Article/42476/1763/page/3

-- Tito

On Apr 7, 2010, at 1:57 AM, Kiel Gillard wrote:

> Can UIViewAnimationTransitionCurlUp/Down be of any use?
> 
> On 07/04/2010, at 2:10 AM, Alex Kac wrote:
> 
>> Well they may have done it with a private API for CoreImage if that exists 
>> (not sure). THey may have done it with OpenGL. They may have taken their 
>> CoreImage code on desktop and ported a part of it to iBooks and used that. 
>> 
>> For you, most likely the best way to do it is using OpenGL.
>> 
>> On Apr 6, 2010, at 10:56 AM, Laurent Daudelin wrote:
>> 
>>> So, no other response from the regular crowd of "resident experts" on how 
>>> Apple engineers did this?
>>> 
>>> -Laurent.
>>> -- 
>>> Laurent Daudelin
>>> AIM/iChat/Skype:LaurentDaudelin 
>>> http://nemesys.dyndns.org
>>> Logiciels Nemesys Software  
>>> laurent.daude...@gmail.com
>>> Photo Gallery Store: 
>>> http://laurentdaudelin.shutterbugstorefront.com/g/galleries
>>> 
>>> On Apr 5, 2010, at 18:32, Alex Kac wrote:
>>> 
 Except CIFilter doesn't exist on the iPad in a public SDK setting.
 
 On Apr 5, 2010, at 8:22 PM, Laurent Daudelin wrote:
 
> On Apr 5, 2010, at 18:02, Graham Cox wrote:
> 
>> CIFilter has a page curl transition effect. Just map the 't' value to 
>> the mouse/finger location.
>> 
>> --Graham
>> 
>> 
>> On 06/04/2010, at 10:55 AM, Laurent Daudelin wrote:
>> 
>>> I got my hands on an iPad today. I was really impressed with the 
>>> built-in book reader. When you flip the page while holding your finger 
>>> down, the page will curl and follow your finger. Very impressive! 
>>> Anybody has any idea how one would be able to achieve such effect?
>> 
> 
> It's that easy?
> 
> -Laurent.
 
>>> 
>>> ___
>>> 
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> 
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net
>>> 
>>> This email sent to a...@webis.net
>> 
>> Alex Kac - President and Founder
>> Web Information Solutions, Inc.
>> 
>> "The optimist proclaims that we live in the best of all possible worlds; and 
>> the pessimist fears this is true."
>> -- James Clabell
>> 
>> 
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com
>> 
>> This email sent to kiel.gill...@gmail.com
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/tciuro%40mac.com
> 
> This email sent to tci...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Correct way to manage drag-delete cursor?

2010-04-07 Thread Graham Cox
Hi all,

I'm working way too hard to make this work, making me think I've just missed 
something obvious.

I have a window containing two main views. I can drag items from one of the 
views into the other view. That all works fine, and is entirely under the 
control of the drag destination in terms of returning the appropriate drag 
operation to set the right cursor.

I also want to be able to drag the items off to delete them. Since that is 
decided by there being no destination, but just a drop outside the window, 
there is no destination to control the cursor, so I'm trying to use the source 
instead, by implementing -draggedImage:movedTo:, testing the point against the 
window's frame, and setting the disappearing item cursor if outside.

The first thing I find is that the point passed is the bottom, left of the 
image, not the cursor. No biggie, I can get the cursor location directly. The 
main problem is when the cursor moves back inside the window, it may or may not 
come under the influence of the destination view again, so simply forcing it to 
the arrow is inappropriate. This is where I find myself doing too much work: 
I'm having to set a flag when I first reset the cursor and clear it again on 
leaving the window and so on, just to figure out when and when not to touch the 
cursor. Surely this scenario was anticipated in the drag/drop design? What's 
the correct way to do this?

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How could I make the first row not to be edited or moved in UITableView

2010-04-07 Thread Jack Nutting
On Tue, Apr 6, 2010 at 11:04 AM, Kalyanraju M  wrote:
> How could I make the first row not to be edited or moved in UITableView
>
> I know that with
> - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath 
> *)indexPath
> the first row could be set not to move but if another cell is dropped above 
> the first one this will we moved down so is moving in the end.
>

Implement this method:

- (NSIndexPath *)tableView:(UITableView *)tableView
targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath
*)sourceIndexPath toProposedIndexPath:(NSIndexPath
*)proposedDestinationIndexPath

Make it check proposedDestinationIndexPath and if it contains a spot
you don't want to be able to drag to (like section 0, row 0), your
method should return an alternate (like section 0, row 1)

-- 
// jack
// http://nuthole.com
// http://learncocoa.org
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: multiple-page print support in NSView

2010-04-07 Thread Keary Suska
On Apr 6, 2010, at 10:11 PM, Rua Haszard Morris wrote:

> I am trying to write an NSView subclass to render a multi-page printout. What 
> I would like is to use the page/paper size in calculating the dimensions of 
> each page; for example, if the printout is made up of N rows of items, each 
> item rendering as 60-point-tall row.
> 
> So, assuming 10 rows of items, the rendered view needs to be 10 * 60 pt high, 
> and the page boundaries need to be set appropriately - if the usable paper 
> area is 120 points high, then we need 5 pages of 2 rows, and if the user 
> specifies much larger paper, e.g. 240 points, then we need 3 pages, each with 
> up to 4 rows (the last page only having two rows).
> 
> How do I implement knowsPageRange, rectForPage, and locationOfPrintRect to 
> achieve this?
> 
> I have tried implementing these methods to set up arbitrary rectangles for 
> each page, and I find that the rendering I do in drawRect is scaled weirdly 
> in the printout, with a huge (half the page) right margin and an even huger 
> (more than half the page, proportional to the total number of pages) top 
> margin.

Without any code, we can't tell you what you are doing wrong.

> A possibly related issue is that the view doesn't know it's actual size (i.e. 
> frame) until it has rendered itself, because of the number of items, and the 
> possibility of large items that take up more than a single row. There may be 
> an interaction between a size given to the view at init time (if it isn't 
> given a size then it doesn't render anything in the printout) and the actual 
> size of the complete printout.

If you want to use -knowsPageRange then you *must* know ahead of time. You 
don't have to know ahead of time if you can keep pages from page breaking at 
inconvenient places, but that can be tricky.

> In general my problems involve the relationship between "page coordinates" 
> and view coordinates - if I can relate these two sizes appropriately then I 
> might be able to get somewhere.

Printing doesn't use a different coordinate system. 0,0 is always lower left. 
Vertical/horizontal centering may change the position of the view on the page.

> Is there sample code or a tutorial somewhere that explains how to set up 
> custom page coordinates? I have read through "Printing Programming Topics for 
> Cocoa", and it seems I'm missing something critical here.

That is pretty much it other than sample code. Are you aware of the sample code 
listings that come with each class reference document? Other than that, the 
only difficult-to-find documentation that is a real hiney-biter is that text is 
always rendered in a flipped coordinate system.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSPrintSavePath not working correctly?

2010-04-07 Thread Brian Postow
More info: When I print out my NSPrintInfo object, I get:

print info {
NSBottomMargin = 90;
NSCopies = 1;
NSDetailedErrorReporting = 0;
NSFaxNumber = "";
NSFirstPage = 1;
NSHorizonalPagination = 2;
NSHorizontallyCentered = 1;
NSJobDisposition = NSPrintSpoolJob;
NSJobSavingFileNameExtensionHidden = 0;
NSJobSavingURL = bob -- /;
NSLastPage = 2147483647;
NSLeftMargin = 72;
NSMustCollate = 1;
NSOrientation = 0;
NSPagesAcross = 1;
NSPagesDown = 1;
NSPaperName = "na-letter";
NSPaperSize = NSSize: {612, 792};
NSPrintAllPages = 1;
NSPrintProtected = 0;
NSPrintSavePath = bob;
NSPrintTime = 0001-12-31 19:00:00 -0500;
NSPrinter = {
"Device Description" = {
 NSDeviceIsPrinter = YES;
 };
"Language Level" = 2;
Name = "Xerox WorkCentre PE120 Series (XRXaa9915f0)";
Type = "Generic PostScript Printer";
};
NSPrinterName = "Xerox WorkCentre PE120 Series (XRXaa9915f0)";
NSRightMargin = 72;
NSSavePath = bob;
NSScalingFactor = 1;
NSTopMargin = 90;
NSVerticalPagination = 0;
NSVerticallyCentered = 1;
}


I woud think that this would mean that the default filename to print to would 
be "bob", or "bob.pdf" but it's still ".pdf.pdf"...

Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Core Data: binding to a sum

2010-04-07 Thread David Catmull
How do I make a table view column show a sum calculated from Core Data Values?

I have a Budget entity with a to-many relationship of BudgetItems. In a table 
view listing my budgets, I want a column that displays the total of a budget's 
items' amounts.

I tried binding the column to ite...@sum.limit, but got this error:
Unknown.m:0: error: -[BudgetTests testBudgetSheet] : [<_NSFaultingMutableSet 
0x102e28500> addObserver:forKeyPath:options:context:] is not supported. Key 
path: @sum.limit
..so I take it the particular NSSet variant used by Core Data doesn't support 
observing @sum. Or did I do that wrong?

I also tried implementing keyPathsForValuesAffectingTotal on my budget class to 
return "items.limit", but that didn't get me any notifications when things 
changed.

The next thing on my agenda is to try manually observing all changes to 
BudgetItems, but I'm struggling with the best way to do that.

-- 
David Catmull
uncom...@uncommonplace.com___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Kyle Sluder
On Apr 6, 2010, at 11:31 PM, Martin Hewitson  
 wrote:


   8   TeXnicle0x00010001e85e - 
[TPTextView insertText:] + 199


You need to show us the code for this method.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Table view question

2010-04-07 Thread Dave

Hi All,

I was wondering if it is possible to change an Object in the  
underlying array associated with a Table View and have the Table update?


If the user clicks an entry in the table I want to change the string  
on one of the rows in a section. My table is arranged as a Number of  
Sections with 4 rows per section, as in:


Section 0
   Row 1
   Row 2
   Row 3
   Row 4

Section 1
  Row 1
  Row 2
  Row 3
  Row 4


For example, if the user clicks on Section 1, Row 3, I want to grab  
the Object (an NSString) for that section/row and change it.


So if the value was "one", then the users clicks it, I want it to  
change to "two"

If "two" change it to "three"
If "three change it to "four"
If "four change it to "one"

Is it possible to change it in-situ or do I have to remove the  
object, change it and add it back?


Also is it ok to do this inside the "cellForRowAtIndexPath" method?

Thanks a lot
All the Best
Dave




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Martin Hewitson
Hi Kyle,

At the moment it does nothing but call super. I was using it to handle 
line-wrapping, but in the process of debugging this problem it's reduced to

- (void)insertText:(id)aString
{
[super insertText:aString];
}


One further piece of info: if I set the layout manager to allow non-contiguous 
layout, I get different errors:

[layoutManager setAllowsNonContiguousLayout:YES];

_NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index 0


Thanks again,

Martin

On Apr 7, 2010, at 5:20 PM, Kyle Sluder wrote:

> On Apr 6, 2010, at 11:31 PM, Martin Hewitson  
> wrote:
> 
>>   8   TeXnicle0x00010001e85e -[TPTextView 
>> insertText:] + 199
> 
> You need to show us the code for this method.
> 
> --Kyle Sluder


Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Stephen J. Butler
On Wed, Apr 7, 2010 at 1:31 AM, Martin Hewitson
 wrote:
>                // Clean up
>                [textContainer release];
>                [layoutManager release];
>                [str release];

Are you sure that all these are balanced releases? The only one you
show allocating is layoutManager. In particular, the [str release]
concerns me.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Jens Alfke


On Apr 7, 2010, at 12:34 AM, Pascal Harris wrote:

I've never programmed games before, although I've got a fair bit of  
useful OS X utility software under my belt.  I've now had a few  
ideas that I'd like to implement - and I'm stuck at almost the first  
hurdle.  I've managed to create an OpenGL view


For a 2D sprite- or tile-based game, it's easier to work with  
CoreAnimation. The API is in Objective-C, is much higher-level, and  
does the in-betweening steps of animations for you. Under the hood, CA  
uses OpenGL.


I wrote a simple CA-based framework for writing board and card games,  
if that's anything like what you're trying to do:

http://bitbucket.org/snej/geekgameboard/

I also started writing an arcade-style game with CA, using the awesome  
Box2D physics library. It was quite easy to get shapes acting like  
real objects onscreen — towers of boxes falling over, etc. Lots and  
lots of iPhone games use Box2D or the similar Chipmunk library for  
their physics models. (Of course you could use these with OpenGL too.  
They don't care how you draw things, they just tell you where to move  
the objects.)


But I can't work out how to get that OpenGL view to accept  
keystrokes from my event loop.


NSViews don't accept keyboard focus by default. You need to override - 
canBecomeKeyView to return YES, and then wire the view up as the  
window's initial key view.


—Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Jens Alfke


On Apr 7, 2010, at 1:54 AM, patrick machielse wrote:

Don't use that, it is no longer up to date. It was a valiant attempt  
at ID3 support, but it doesn't adhere to the ID3 specifications very  
well and it stumbles on real world tags more often than other  
solutions do.


Yeah; after running into some bugs, and looking through the source  
code, I decided I wasn't comfortable letting it rewrite MP3 files.  
It's all too easy to imagine a bug in the code destroying files, which  
would make me and/or hypothetical end-users very sad.


TagLib adheres strictly to the ID3 standard but by default it uses  
workarounds for the instances when iTunes doesn't... It is also very  
stable, actively developed, it's covered by a usable license (lgpl),  
supports more tags than just ID3, and there's a development mailing  
list. What more do you want?


Interesting! Does it support AAC files? (Those don't use ID3, they use  
QuickTime 'atoms' for the same purpose.)


FYI to the OP: If you haven't worked with LGPL code before, be aware  
that you must build it into a separate dynamic library or framework  
that you can bundle inside your app. Statically linking the code into  
your app violates the LGPL license, unless you also release your  
entire app under the LGPL. (Unfortunately this makes using LGPL code  
in iPhone apps virtually impossible, but that's probably not an issue  
in this case...)


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Table view question

2010-04-07 Thread Jens Alfke

Um, is this for OS X or iPhone? You need to make that clear...

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Martin Hewitson
Yes, they are. Sorry, I was over selective in my first post in an attempt to 
just show the salient points. Here's a more complete excerpt from the code that 
sets up the text storage etc:

// Get the string from the File entity
NSError *error = nil;
NSString *str = [[NSString alloc] initWithData:[file 
valueForKey:@"content"]
  
encoding:NSUTF8StringEncoding];
if (error) {
[NSApp presentError:error];
return nil;
}

// Setup undo manager for this file
undoManager = [[NSUndoManager alloc] init];

// Setup a text storage to hold this string
NSMutableAttributedString *attStr = 
[[[NSMutableAttributedString alloc] initWithString:str] autorelease];

textStorage = [[NSTextStorage alloc] 
initWithAttributedString:attStr];


// Add a main layout manager
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
[layoutManager setAllowsNonContiguousLayout:NO];
[textStorage addLayoutManager:layoutManager];

// Now add the container to the layout manager
NSTextContainer *textContainer = [[NSTextContainer alloc] init];
[layoutManager addTextContainer:textContainer];

// Clean up
[textContainer release];
[layoutManager release];
[str release];


I think that's all ok, but I could be wrong. Again, the main point seems to be 
that this works as long as "str" is not empty. If it is, then I get those 
exceptions when the first character is typed in the text view.

Thanks again,

Martin



On Apr 7, 2010, at 6:27 PM, Stephen J. Butler wrote:

> On Wed, Apr 7, 2010 at 1:31 AM, Martin Hewitson
>  wrote:
>>// Clean up
>>[textContainer release];
>>[layoutManager release];
>>[str release];
> 
> Are you sure that all these are balanced releases? The only one you
> show allocating is layoutManager. In particular, the [str release]
> concerns me.
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de
> 
> This email sent to martin.hewit...@aei.mpg.de


Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


iPad: Device Orientation

2010-04-07 Thread Development
Ok I'm going to try to explain this...

I have an application with two different view controllers. One view controller 
handles a compose mail UI. The built in message frame work one. That is usually 
allowed to reorient to any device orientation but will usually be used only in 
portrait. 

The second(an editor) is manually set to landscape left. 

Now, if I load the editor that has to be manually set to landscape first then 
the whole interface works perfectly. However if I load the mail composer first, 
which will reorient to any orientation it messes the editor up.

Basically after loading the mail composer and dismissing it, if I go to the 
editor it only checks the last known interface orientation which is usually 
portrait (It still doesn't work if the last one was landscape). This is even 
though I am manually reorienting the status bar and the device is in fact being 
turned to landscape left.  And turning the device does not cause it to recheck 
the orientation in the shouldautorotate method.

The device only shows that it is still in portrait even though the status bar 
shows that it is correctly oriented. 
So basically I have no idea how to correct this since even if I manually rotate 
the UIView that I am displaying it does not display correctly. Am I doing 
something wrong or am I up against a bug? BTW this works just fine on iPhone 
just not on iPad___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Table view question

2010-04-07 Thread Dave

Hi,

Sorry for the iPhone.

I've actually managed to get this working now, but not sure if it's  
the best/right way to do it. Here is a code snippet from  
tableView:didSelectRowAtIndex



myKey - [self.mKeyArray objectAtIndex:theIndexPath.section];
myDictionary = [self.mDictionary objectForKey:myKey];
myString = [myDictionary objectForKey:@"FieldX"];
if ([myString isEqualToString:@"One"] == YES)
{
[myString release];
myString = @"Two";
}
else
{
[myString release];
myString = @"One";
}

[myDictionary setValue: myString forKey:@"FieldX"];
[self.tableView reloadData];

Thanks a lot
All the Best
Dave




On 7 Apr 2010, at 17:36, Jens Alfke wrote:


Um, is this for OS X or iPhone? You need to make that clear...

—Jens




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data: binding to a sum

2010-04-07 Thread Keary Suska
On Apr 7, 2010, at 9:14 AM, David Catmull wrote:

> How do I make a table view column show a sum calculated from Core Data Values?
> 
> I have a Budget entity with a to-many relationship of BudgetItems. In a table 
> view listing my budgets, I want a column that displays the total of a 
> budget's items' amounts.
> 
> I tried binding the column to ite...@sum.limit, but got this error:
> Unknown.m:0: error: -[BudgetTests testBudgetSheet] : [<_NSFaultingMutableSet 
> 0x102e28500> addObserver:forKeyPath:options:context:] is not supported. Key 
> path: @sum.limit
> ..so I take it the particular NSSet variant used by Core Data doesn't support 
> observing @sum. Or did I do that wrong?

Yes, because you are trying to observe an element of a set. Same goes for 
arrays. Instead, add an array controller whose content is bound to "items", and 
bind to arrangedObjects->@sum.limit.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Laurent Daudelin
On Apr 7, 2010, at 09:28, Jens Alfke wrote:

> On Apr 7, 2010, at 12:34 AM, Pascal Harris wrote:
> 
>> I've never programmed games before, although I've got a fair bit of useful 
>> OS X utility software under my belt.  I've now had a few ideas that I'd like 
>> to implement - and I'm stuck at almost the first hurdle.  I've managed to 
>> create an OpenGL view
> 
> For a 2D sprite- or tile-based game, it's easier to work with CoreAnimation. 
> The API is in Objective-C, is much higher-level, and does the in-betweening 
> steps of animations for you. Under the hood, CA uses OpenGL.
> 
> I wrote a simple CA-based framework for writing board and card games, if 
> that's anything like what you're trying to do:
>   http://bitbucket.org/snej/geekgameboard/

Jens,

Is there an easy way to download the whole package? I looked around and besides 
downloading each item individually, I didn't see anything like a dmg or zip or 
svn link.

Thanks!

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://nemesys.dyndns.org
Logiciels Nemesys Software  
laurent.daude...@gmail.com
Photo Gallery Store: 
http://laurentdaudelin.shutterbugstorefront.com/g/galleries___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

2010-04-07 Thread Ignacio Enriquez
Hi everybody.
I get this link error:
Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
every time I try to run my program.
This runs perfectly in a new iMac 27' but in my macBook and other kind
of old iMac error appears.
I am running snow leopard 10.6.2 with the latest Xcode 3.2.2. in all
the machines.
I also tried disabling llvm link optimization flag without success.

These is getting my many troubles, and I am stuck with my projects.
Any thoughts?
Thanks in advance.

Ignacio.

BTW: I am trying to run a standard c++ project with OpenGL GLUT
Foundation frameworks. (If this matters)

-- 

慶應義塾大学大学院 理工学研究科
開放環境科学専攻 斎藤英雄研究室
修士1年 Guillermo Ignacio Enriquez G.
e-mail :  nach...@hvrl.ics.keio.ac.jp

_
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


change the CGColorSpace when using a CIFilter to use 16bits/channel images

2010-04-07 Thread paul morel

Hi,does anybody knows how to change the colorspace when we want to use a 
CIFilter?It seems possible looking at the question asked : 
http://lists.apple.com/archives/quartz-dev/2008/Aug/msg00060.html
But I didn't manage to change it. My guess is that if I can change the 
colorspace from RGBA 8bits/channel to RGBA 16bits/channel I will be able to 
process images with a CIFilter which works with  RGBA 16bits/channelinstead of  
RGBA 8bits/channel , am I right?
Thanks,
Paul  
_
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

2010-04-07 Thread Kyle Sluder
2010/4/7 Ignacio Enriquez :
> I get this link error:
> Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
> every time I try to run my program.

You should ask questions about developer tools on the xcode-users list.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

2010-04-07 Thread Ken Thomases
This has nothing to do with Cocoa.  Try the xcode-users list.

Regards,
Ken

On Apr 7, 2010, at 12:40 PM, Ignacio Enriquez wrote:

> Hi everybody.
> I get this link error:
> Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
> every time I try to run my program.
> This runs perfectly in a new iMac 27' but in my macBook and other kind
> of old iMac error appears.
> I am running snow leopard 10.6.2 with the latest Xcode 3.2.2. in all
> the machines.
> I also tried disabling llvm link optimization flag without success.
> 
> These is getting my many troubles, and I am stuck with my projects.
> Any thoughts?
> Thanks in advance.
> 
> Ignacio.
> 
> BTW: I am trying to run a standard c++ project with OpenGL GLUT
> Foundation frameworks. (If this matters)


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

2010-04-07 Thread Ignacio Enriquez
ok.
sorry

On Thu, Apr 8, 2010 at 2:53 AM, Ken Thomases  wrote:
> This has nothing to do with Cocoa.  Try the xcode-users list.
>
> Regards,
> Ken
>
> On Apr 7, 2010, at 12:40 PM, Ignacio Enriquez wrote:
>
>> Hi everybody.
>> I get this link error:
>> Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1
>> every time I try to run my program.
>> This runs perfectly in a new iMac 27' but in my macBook and other kind
>> of old iMac error appears.
>> I am running snow leopard 10.6.2 with the latest Xcode 3.2.2. in all
>> the machines.
>> I also tried disabling llvm link optimization flag without success.
>>
>> These is getting my many troubles, and I am stuck with my projects.
>> Any thoughts?
>> Thanks in advance.
>>
>> Ignacio.
>>
>> BTW: I am trying to run a standard c++ project with OpenGL GLUT
>> Foundation frameworks. (If this matters)
>
>
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Seth Willits
On Apr 7, 2010, at 12:34 AM, Pascal Harris wrote:

> Sorry to post such a non-technical question - I didn't know who else to ask.

Hi Pascal,


http://www.idevgames.com/forum/ -- Tons of active members willing to help.


--
Seth Willits



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Raffael Cavallaro

On Apr 7, 2010, at 1:31 PM, Laurent Daudelin wrote:

> Jens,
> 
> Is there an easy way to download the whole package? I looked around and 
> besides downloading each item individually, I didn't see anything like a dmg 
> or zip or svn link.

At the top of the page it says:

"Clone this repository (size: 959.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/snej/geekgameboard/";

This means you need mercurial:



warmest regards,

Ralph


this means you need the hg
Raffael Cavallaro
raffaelcavall...@me.com





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Philip Mobley
On Apr 7, 2010, at 10:31 AM, Laurent Daudelin wrote:

> Is there an easy way to download the whole package? I looked around and 
> besides downloading each item individually, I didn't see anything like a dmg 
> or zip or svn link.

At the far top-right, there is a button labeled "Get Source" which lets you 
download the source in several formats including ZIP.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPad: Device Orientation

2010-04-07 Thread David Duncan
How are you checking and working with orientations?

If your using the View Controller orientation notifications, then this should 
just work (if your doing everything correctly). If your using UIDevice 
orientation notifications (which it sounds like since you have to move the 
status bar manually) then that would explain why this isn't doing the right 
thing.

On Apr 7, 2010, at 10:07 AM, Development wrote:

> Ok I'm going to try to explain this...
> 
> I have an application with two different view controllers. One view 
> controller handles a compose mail UI. The built in message frame work one. 
> That is usually allowed to reorient to any device orientation but will 
> usually be used only in portrait. 
> 
> The second(an editor) is manually set to landscape left. 
> 
> Now, if I load the editor that has to be manually set to landscape first then 
> the whole interface works perfectly. However if I load the mail composer 
> first, which will reorient to any orientation it messes the editor up.
> 
> Basically after loading the mail composer and dismissing it, if I go to the 
> editor it only checks the last known interface orientation which is usually 
> portrait (It still doesn't work if the last one was landscape). This is even 
> though I am manually reorienting the status bar and the device is in fact 
> being turned to landscape left.  And turning the device does not cause it to 
> recheck the orientation in the shouldautorotate method.
> 
> The device only shows that it is still in portrait even though the status bar 
> shows that it is correctly oriented. 
> So basically I have no idea how to correct this since even if I manually 
> rotate the UIView that I am displaying it does not display correctly. Am I 
> doing something wrong or am I up against a bug? BTW this works just fine on 
> iPhone just not on iPad

--
David Duncan
Apple DTS Animation and Printing

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread patrick machielse
Op 7 apr 2010, om 18:33 heeft Jens Alfke het volgende geschreven:

> On Apr 7, 2010, at 1:54 AM, patrick machielse wrote:
> 
>> Don't use that, it is no longer up to date.
> 
> Yeah; after running into some bugs, and looking through the source code, I 
> decided I wasn't comfortable letting it rewrite MP3 files.

I used it for a while. Considering the age and the style of the code the 
results were much better than expected. However, once our software needed to 
process millions of files/tags each month, we needed something that was coded 
to higher standards.

Alas (and surprisingly) Apple doesn't provide a good, unified, solution for 
reading and writing various audio file tags.

> Does it support AAC files? (Those don't use ID3, they use QuickTime 'atoms' 
> for the same purpose.)

There is support for APE, ASF, FLAC, MP4 (aac/alac), ID3, WAV, OGG, ... I only 
use ID3 and MP4 atoms at the moment, and that works great.

patrick
--
Patrick Machielse
Hieper Software

http://www.hieper.nl
i...@hieper.nl

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPad: Device Orientation

2010-04-07 Thread Development
Well in the viewcontrollers I'm using the  - 
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
 and returning yes when the orientation is: UIInterfaceOrientationLandscapeLeft 
for the editor and YES when it's portrait in the mail composer.

I am not using device notifications at all, I just added the generate 
notifications call thinking maybe it was not correctly generating the 
notification for the above method. But if I load the mail composer view 
controller first the device just sticks in portrait even if you rotate it and 
try again.

I have to manually rotate the interface because the editor requires a large 
area to work in. It has to be in landscape. That is why I manually rotate the 
interface. If there is a better way to make sure that the editor always loads 
in landscape I'd be happy to use it as right now my only option is to force the 
editor to load at app launch thus making sure that no matter what I do the 
orientation is always correct.



On Apr 7, 2010, at 11:22 AM, David Duncan wrote:

> How are you checking and working with orientations?
> 
> If your using the View Controller orientation notifications, then this should 
> just work (if your doing everything correctly). If your using UIDevice 
> orientation notifications (which it sounds like since you have to move the 
> status bar manually) then that would explain why this isn't doing the right 
> thing.
> 
> On Apr 7, 2010, at 10:07 AM, Development wrote:
> 
>> Ok I'm going to try to explain this...
>> 
>> I have an application with two different view controllers. One view 
>> controller handles a compose mail UI. The built in message frame work one. 
>> That is usually allowed to reorient to any device orientation but will 
>> usually be used only in portrait. 
>> 
>> The second(an editor) is manually set to landscape left. 
>> 
>> Now, if I load the editor that has to be manually set to landscape first 
>> then the whole interface works perfectly. However if I load the mail 
>> composer first, which will reorient to any orientation it messes the editor 
>> up.
>> 
>> Basically after loading the mail composer and dismissing it, if I go to the 
>> editor it only checks the last known interface orientation which is usually 
>> portrait (It still doesn't work if the last one was landscape). This is even 
>> though I am manually reorienting the status bar and the device is in fact 
>> being turned to landscape left.  And turning the device does not cause it to 
>> recheck the orientation in the shouldautorotate method.
>> 
>> The device only shows that it is still in portrait even though the status 
>> bar shows that it is correctly oriented. 
>> So basically I have no idea how to correct this since even if I manually 
>> rotate the UIView that I am displaying it does not display correctly. Am I 
>> doing something wrong or am I up against a bug? BTW this works just fine on 
>> iPhone just not on iPad
> 
> --
> David Duncan
> Apple DTS Animation and Printing
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Michael Ash
On Wednesday, April 7, 2010, Jens Alfke  wrote:
>
> FYI to the OP: If you haven't worked with LGPL code before, be aware that you 
> must build it into a separate dynamic library or framework that you can 
> bundle inside your app. Statically linking the code into your app violates 
> the LGPL license, unless you also release your entire app under the LGPL. 
> (Unfortunately this makes using LGPL code in iPhone apps virtually 
> impossible, but that's probably not an issue in this case...)

Statically linking the code into your app does not automatically
violate the LGPL, although it does make it harder to comply. The key
requirement of the LGPL is that end users must be able to use your app
with a copy of the library that they built themselves. If you liked
the library dynamically then this is easy since they can just pull it
out of the app and put in their own build.

For static linking it's harder, but doable. The standard technique is
to make available the object files (.o files) from your application.
These can be linked with a new copy of the static library to produce a
new copy of the app that uses a custom build of the library, thus
fulfilling that LGPL requirement.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


copy/paste in modal window

2010-04-07 Thread Dave McCarthy
Someone posted essentially this same question in 2004 but there were no answers.

I've got a Cocoa plugin running inside a host application. The plugin opens an 
NSOpenPanel, and as a result of user action there, a modal window containing 
two NSTextFields. I'd like the user to be able to copy and paste text in those 
fields, but all they do is beep, presumably because the host application has 
disabled the copy/cut/paste commands.

I tried implementing keyDown in my window controller but it is never called. I 
tried subclassing NSWindow and implementing keyDown there but it is never 
called. Maybe keyDown isn't even the right place to be looking, but my Cocoa 
experience is limited. What should I do to allow copy/paste for these controls?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problems with repetetive execution of netstat using NSTask and NSTimer

2010-04-07 Thread Kazior Fukacz

Thanks for your answers!

By the way, are you using garbage collection?  If not, then you're  
leaking several objects (those pointed to by 'netstat', 'pipe',  
and 'string').


Yeah, I suspect that the pipes (and corresponding NSFileHandles)  
are indeed leaking, and that's the real problem.  You may also want  
to create and launch NSTask instances inside an exception handler,  
since it and NSFileHandle/NSPipe can raise some unexpected exceptions.


I'm coding under Tiger using XCode 2.5. As far as I know garbage  
collection was introduced in XCode 3 which came with Objective-C 2.0,  
am I right?


Anyway, I tried putting a NSAutoreleasePool and draining it every  
time my method finishes its work. I also tried releasing the pipe  
manually. Still no luck.


However, putting "assert(pipe != null)" right before "[netstat  
setStandardOutput: pipe];" ended up with "(...)/IPShowX/IPShowX.m:32:  
failed assertion `pipe != nil'". It happened about 15 minutes after  
launching. This might be helpful in determining what the reason of  
this problem might be. As we can see it is NSPipe-related. Something  
about allocation, initialization and releasing?


How is it that it starts to malfunction after such amount of time?

Regards,
kaziorvb
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problems with repetetive execution of netstat using NSTask and NSTimer

2010-04-07 Thread Kazior Fukacz

Hello,


How is it that it starts to malfunction after such amount of time?


Because the leak builds up over time until you run out of file  
descriptors, and -[NSPipe init] finally starts returning nil.


Yeah, I figured it out like 10 minutes after I asked that question.  
Found this discussion helpful:

http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg03221.html

I think I finally managed to fix my issues. First of all, I added  
these two lines, which seem to change the most:


[netstat waitUntilExit];
[netstat release];

Secondly, I'm now initializing NSPipe like this:

NSPipe *thePipe = [NSPipe pipe];

instead of:

NSPipe *thePipe = [[NSPipe alloc] init];

Finally, I made a few other changes. For an overview, take a look how  
my .m code looked like before:


http://ipshowx.pastebin.com/ARFR3HRr

and how it looks now:

http://ipshowx.pastebin.com/wbpX3qGq

I know there are still a few things that I should change but as I  
said, it's my first Cocoa application and I've got a lot to learn :)


Anyway, thank you all for your replies. As you can see, you pointed  
me in the right direction and clarified some things to me.


Regards,
kaziorvb

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPad: Device Orientation

2010-04-07 Thread Development
Possible answer to this

The forums seem to have a some people posting very similar issues to this one. 
I'm assuming this means that since my iPhone version of the application works 
perfectly, and because I'm not the only one having this problem that this is a 
platform issue, in other words needs a bug report. In the mean time the work 
around that I have been forced to use is to load the editor view at app launch. 
Because this is a document editing application it is not unreasonable to do 
this on the iPad version however I'd much prefer to load the main menu first.

On Apr 7, 2010, at 11:50 AM, Development wrote:

> Well in the viewcontrollers I'm using the  - 
> (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
>  and returning yes when the orientation is: 
> UIInterfaceOrientationLandscapeLeft for the editor and YES when it's portrait 
> in the mail composer.
> 
> I am not using device notifications at all, I just added the generate 
> notifications call thinking maybe it was not correctly generating the 
> notification for the above method. But if I load the mail composer view 
> controller first the device just sticks in portrait even if you rotate it and 
> try again.
> 
> I have to manually rotate the interface because the editor requires a large 
> area to work in. It has to be in landscape. That is why I manually rotate the 
> interface. If there is a better way to make sure that the editor always loads 
> in landscape I'd be happy to use it as right now my only option is to force 
> the editor to load at app launch thus making sure that no matter what I do 
> the orientation is always correct.
> 
> 
> 
> On Apr 7, 2010, at 11:22 AM, David Duncan wrote:
> 
>> How are you checking and working with orientations?
>> 
>> If your using the View Controller orientation notifications, then this 
>> should just work (if your doing everything correctly). If your using 
>> UIDevice orientation notifications (which it sounds like since you have to 
>> move the status bar manually) then that would explain why this isn't doing 
>> the right thing.
>> 
>> On Apr 7, 2010, at 10:07 AM, Development wrote:
>> 
>>> Ok I'm going to try to explain this...
>>> 
>>> I have an application with two different view controllers. One view 
>>> controller handles a compose mail UI. The built in message frame work one. 
>>> That is usually allowed to reorient to any device orientation but will 
>>> usually be used only in portrait. 
>>> 
>>> The second(an editor) is manually set to landscape left. 
>>> 
>>> Now, if I load the editor that has to be manually set to landscape first 
>>> then the whole interface works perfectly. However if I load the mail 
>>> composer first, which will reorient to any orientation it messes the editor 
>>> up.
>>> 
>>> Basically after loading the mail composer and dismissing it, if I go to the 
>>> editor it only checks the last known interface orientation which is usually 
>>> portrait (It still doesn't work if the last one was landscape). This is 
>>> even though I am manually reorienting the status bar and the device is in 
>>> fact being turned to landscape left.  And turning the device does not cause 
>>> it to recheck the orientation in the shouldautorotate method.
>>> 
>>> The device only shows that it is still in portrait even though the status 
>>> bar shows that it is correctly oriented. 
>>> So basically I have no idea how to correct this since even if I manually 
>>> rotate the UIView that I am displaying it does not display correctly. Am I 
>>> doing something wrong or am I up against a bug? BTW this works just fine on 
>>> iPhone just not on iPad
>> 
>> --
>> David Duncan
>> Apple DTS Animation and Printing
>> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/development%40fornextsoft.com
> 
> This email sent to developm...@fornextsoft.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Jens Alfke


On Apr 7, 2010, at 11:08 AM, Raffael Cavallaro wrote:


At the top of the page it says:

"Clone this repository (size: 959.4 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/snej/geekgameboard/";

This means you need mercurial:


No you don't — you can just click the "get source" button at the top  
right and download as zip or tar.


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: copy/paste in modal window

2010-04-07 Thread Kyle Sluder
On Tue, Apr 6, 2010 at 2:11 PM, Dave McCarthy  wrote:
> I tried implementing keyDown in my window controller but it is never called. 
> I tried subclassing NSWindow and implementing keyDown there but it is never 
> called. Maybe keyDown isn't even the right place to be looking, but my Cocoa 
> experience is limited. What should I do to allow copy/paste for these 
> controls?

Look up NSUserInterfaceValidation. But most likely there's nothing you
can do but complain to the author of your host app, especially if your
Cocoa plug-in is hosted by a Carbon app.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: multiple-page print support in NSView

2010-04-07 Thread Rua Haszard Morris
>> I am trying to write an NSView subclass to render a multi-page printout. 
>> What I would like is to use the page/paper size in calculating the 
>> dimensions of each page; for example, if the printout is made up of N rows 
>> of items, each item rendering as 60-point-tall row.
>> 
>> So, assuming 10 rows of items, the rendered view needs to be 10 * 60 pt 
>> high, and the page boundaries need to be set appropriately - if the usable 
>> paper area is 120 points high, then we need 5 pages of 2 rows, and if the 
>> user specifies much larger paper, e.g. 240 points, then we need 3 pages, 
>> each with up to 4 rows (the last page only having two rows).
>> 
>> How do I implement knowsPageRange, rectForPage, and locationOfPrintRect to 
>> achieve this?
>> 
>> I have tried implementing these methods to set up arbitrary rectangles for 
>> each page, and I find that the rendering I do in drawRect is scaled weirdly 
>> in the printout, with a huge (half the page) right margin and an even huger 
>> (more than half the page, proportional to the total number of pages) top 
>> margin.
I found my problem - I needed to set the pagination options on the NSPrintInfo 
appropriately, otherwise the automatic pagination interacts with my custom 
pagination. The trick was to implement print: myself and set up the NSPrintInfo 
and the current NSPrintOperation, so the rest of my view code could 
successfully query the page size, margins etc.

   NSPrintOperation* po = [NSPrintOperation printOperationWithView:self];
   NSPrintInfo *pInfo = [po printInfo];
   [NSPrintOperation setCurrentOperation:po];
   [pInfo setHorizontalPagination:NSFitPagination];
   [pInfo setVerticalPagination:NSClipPagination];

>> Is there sample code or a tutorial somewhere that explains how to set up 
>> custom page coordinates? I have read through "Printing Programming Topics 
>> for Cocoa", and it seems I'm missing something critical here.
> That is pretty much it other than sample code. Are you aware of the sample 
> code listings that come with each class reference document? Other than that, 
> the only difficult-to-find documentation that is a real hiney-biter is that 
> text is always rendered in a flipped coordinate system.
Good point, I see there are a range of Sketch related and other samples listed 
in the links for NSPrintOperation, NSPrintInfo.

I should mention that the documentation changed a lot over the weekend, the new 
Printing Programming Topics for Cocoa is slightly more helpful!

thanks for the advice
Rua HM.

--
http://cartoonbeats.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


iPad: UIImagePickerController

2010-04-07 Thread Development
How do you use the image picker controller on the iPad? My iphone version works 
fine but I get a UI Mess on the iPad. (Part of the nav bar loads and nothing 
else.) Anyway so I tried 
if ([[[UIDevice currentDevice]model]containsString:@"iPad"]){
if( [UIImagePickerController 
isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary ] ||
   [UIImagePickerController 
isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum ])
{

mainPicker = [[UIImagePickerController alloc] init];
NSLog(@"Picker %@",mainPicker);
mainPicker.sourceType = 
UIImagePickerControllerSourceTypePhotoLibrary & 
UIImagePickerControllerSourceTypeSavedPhotosAlbum;

mainPicker.delegate = self;

mainPicker.allowsImageEditing = YES;
[[UIApplication 
sharedApplication]setStatusBarOrientation:UIInterfaceOrientationPortrait 
animated:YES];

[delegate slideSubview:pickerParent fromTop:YES];
[self presentModalViewController:mainPicker 
animated:YES];
} 
}


And now it crashes telling me I have to use a popover:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: 'On iPad, UIImagePickerController must be presented via 
UIPopoverController'


Are the any examples of how to present a UIImagePicker on the 
iPad?___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPad: UIImagePickerController

2010-04-07 Thread Ricky Sharp

On Apr 7, 2010, at 3:37 PM, Development wrote:

> How do you use the image picker controller on the iPad? My iphone version 
> works fine but I get a UI Mess on the iPad.


> And now it crashes telling me I have to use a popover:
> 
> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
> reason: 'On iPad, UIImagePickerController must be presented via 
> UIPopoverController'


That's because on iPad, image pickers must be used within a popover (just what 
the exception instructs).  I strongly suggest you read the iPad Human Interface 
Guidelines as well as the corresponding programming guide.

Also, a potential better forum for UIKit questions is the dedicated iPhone OS 
forums at developer.apple.com

___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPad: UIImagePickerController

2010-04-07 Thread Luke the Hiesterman
On Apr 7, 2010, at 1:37 PM, Development wrote:

> How do you use the image picker controller on the iPad? My iphone version 
> works fine but I get a UI Mess on the iPad. (Part of the nav bar loads and 
> nothing else.) Anyway so I tried 
>   if ([[[UIDevice currentDevice]model]containsString:@"iPad"]){

No. Don't do this. If you want to check for iPad, use if ([[UIDevice 
currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomiPad). There's also a 
convenience macro included in UIDevice.h intended for people deploying on 
pre-3.2 versions of the OS so you won't crash on unknown selector.
> 
> And now it crashes telling me I have to use a popover:
> 
> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
> reason: 'On iPad, UIImagePickerController must be presented via 
> UIPopoverController'
> 
> 
> Are the any examples of how to present a UIImagePicker on the 
> iPad?___
> 

Create a popover, add the picker as the content view controllerviola.

Luke___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Ross Carter
On Apr 7, 2010, at 11:52 AM, Martin Hewitson  wrote:

> Hi Kyle,
> 
> At the moment it does nothing but call super. I was using it to handle 
> line-wrapping, but in the process of debugging this problem it's reduced to
> 
> - (void)insertText:(id)aString
> {
>   [super insertText:aString];
> }

I would set a breakpoint here and examine a description of the textStorage and 
the layoutManager. Also, are you creating the NSTextStorage from an empty 
string? Nil? Or possibly some other value?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: OS X Game Programming

2010-04-07 Thread Raffael Cavallaro

On Apr 7, 2010, at 3:58 PM, Jens Alfke wrote:

> On Apr 7, 2010, at 11:08 AM, Raffael Cavallaro wrote:
> 
>> At the top of the page it says:
>> 
>> "Clone this repository (size: 959.4 KB): HTTPS / SSH
>> $ hg clone http://bitbucket.org/snej/geekgameboard/";
>> 
>> This means you need mercurial:
> 
> No you don't — you can just click the "get source" button at the top right 
> and download as zip or tar.

Sorry about the misinformation - I only saw the hg clone line up top, so that's 
how I got the source.

warmest regards,

Ralph


Raffael Cavallaro
raffaelcavall...@me.com





___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPad: UIImagePickerController

2010-04-07 Thread Development
I had gotten lost because I forgot that I had the project's base SDK set to 3.0 
so that the iPhone version would build and launch.
I couldn't find the popover controller api and was very confused. Sorry.

On Apr 7, 2010, at 1:43 PM, Ricky Sharp wrote:

> 
> On Apr 7, 2010, at 3:37 PM, Development wrote:
> 
>> How do you use the image picker controller on the iPad? My iphone version 
>> works fine but I get a UI Mess on the iPad.
> 
> 
>> And now it crashes telling me I have to use a popover:
>> 
>> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
>> reason: 'On iPad, UIImagePickerController must be presented via 
>> UIPopoverController'
> 
> 
> That's because on iPad, image pickers must be used within a popover (just 
> what the exception instructs).  I strongly suggest you read the iPad Human 
> Interface Guidelines as well as the corresponding programming guide.
> 
> Also, a potential better forum for UIKit questions is the dedicated iPhone OS 
> forums at developer.apple.com
> 
> ___
> Ricky A. Sharp mailto:rsh...@instantinteractive.com
> Instant Interactive(tm)   http://www.instantinteractive.com
> 
> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSPrintInfo, setting filename for print to PDF?

2010-04-07 Thread Brian Postow
Ok, I'm still working on this from my other question. I can see the printinfo 
before I run the operation, and it looks correct. NSSavePath is set to the path 
I want, as is the jobsavingURL. When, but when I actually DO the print to PDF, 
the filename, the filename becomes .pdf.pdf.

When I cancel out of the print, the printinfo says the value is "" If I 
actually type something in and SAVE, then nsSavePath has the path to the save 
file. 

I can't find any sample code that tries to do this, and when I google search, I 
get my own questions. Obviously, I'm searching for the wrong thing (cocoa "save 
to pdf" nsprintinfo; for example). Can someone give me a pointer of a better 
search term, even if you don't know the answer?

thanks.


Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to subclass UIButton?

2010-04-07 Thread WT
Hello all,

I need to create a custom bar of UIButton instances which can be scrolled left 
and right using a swipe gesture. I am thus following the "Autoscroll" sample 
code from Apple, which subclasses UIImageView to produce a scrollable bar of 
thumbnail images. My problem is how to correctly subclass UIButton, since the 
only available means of instantiating a button is through the class method 
+buttonWithType:.

Once I allocate an instance of the subclass, how do I initialize it with the 
desired type? The buttonType property is read-only and there is no instance 
method -initWithType: in the public API.

One alternative I see is to use composition rather than subclassing, 
essentially creating a decorator for UIButton, but I'd rather not have to do 
that.

Another option is to fake a button using UIImageView, just like the 
"Autoscroll" example does, but I'd prefer to have actual UIButton instances.

Am I missing something trivial here? If UIButton was designed in such a way to 
prevent subclassing, what would you suggest as the best alternative?

Thanks in advance.
WT.___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Character Map

2010-04-07 Thread Ian was here
Does anyone know to programmatically bring up the special characters panel that 
TextEdit shows when you select the "Special Characters..." item in the Edit 
menu?


  
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How does Finder determine when a file is busy being written to the disk?

2010-04-07 Thread Lee Gillen
When copying large files (over a GB each) from a network drive to a
local drive Finder shows these files are busy by graying their
filename out until they are finished writing to the local system.

How can I detect this as well?

I tried calling the NSFileManager fileAttributesAtPath:traverseLink:
method to get the NSFileBusy attribute, but this attribute is null.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Wondering about that iPad page curling

2010-04-07 Thread Fritz Anderson
On 7 Apr 2010, at 5:44 AM, Tito Ciuro wrote:

> How about this example? You can download the source as well:
> 
> http://www.devx.com/wireless/Article/42476/1763/page/3

Given that the article's title and opening paragraph suggest that it's about 
something pretty elementary, and site wants a "free" registration to show you 
any more, I'd like to hear from people who have read the whole thing whether 
page-curling is really in there, and maybe a thumbnail of what the author said.

— F

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Character Map

2010-04-07 Thread Jens Alfke


On Apr 7, 2010, at 4:28 PM, Ian was here wrote:

Does anyone know to programmatically bring up the special characters  
panel that TextEdit shows when you select the "Special  
Characters..." item in the Edit menu?


There's a menu item for it in the Edit menu, in any new app's nib.  
Take a look at what that item is wired up to.


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-07 Thread Jens Alfke


On Apr 7, 2010, at 4:31 PM, Lee Gillen wrote:


When copying large files (over a GB each) from a network drive to a
local drive Finder shows these files are busy by graying their
filename out until they are finished writing to the local system.


I think the Finder only knows that because it's the one doing the  
copying. If something else is copying a file (like the 'cp' command)  
the Finder doesn't gray out the file.


Unix doesn't really have a notion of a file being "busy", except via  
higher level mechanisms like exclusive locks. In general, I think it's  
difficult to figure out if some other process has opened a file. The  
'lsof' tool does it, but I think it uses privileged system calls.


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Wondering about that iPad page curling

2010-04-07 Thread Philip Mobley
On Apr 7, 2010, at 4:46 PM, Fritz Anderson wrote:

> Given that the article's title and opening paragraph suggest that it's about 
> something pretty elementary, and site wants a "free" registration to show you 
> any more, I'd like to hear from people who have read the whole thing whether 
> page-curling is really in there, and maybe a thumbnail of what the author 
> said.

I signed up and read it... and its there.  The only issue I had with signing up 
is that it seems like that is the only useful iPhone tutorial on the entire 
site.

But in fact the tutorial is quite good, especially for someone familiar with 
Cocoa but hasn't written an iPhone app.  No special "hacks" were used, just 
declared constants for animation styles.



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Character Map

2010-04-07 Thread Graham Cox

On 08/04/2010, at 9:50 AM, Jens Alfke wrote:

>> Does anyone know to programmatically bring up the special characters panel 
>> that TextEdit shows when you select the "Special Characters..." item in the 
>> Edit menu?
> 
> There's a menu item for it in the Edit menu, in any new app's nib. Take a 
> look at what that item is wired up to.


The item is added dynamically when the app is run, so to find its action/target 
will require a little bit of code to flush it out at runtime.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-07 Thread Sean McBride
On Wed, 7 Apr 2010 19:31:19 -0400, Lee Gillen said:

>When copying large files (over a GB each) from a network drive to a
>local drive Finder shows these files are busy by graying their
>filename out until they are finished writing to the local system.

Not sure if it still applies these days, but look through Finder.h, and
read about kFirstMagicBusyFiletype and kMagicBusyCreationDate.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How does Finder determine when a file is busy being written to the disk?

2010-04-07 Thread Lee Gillen
On Wed, Apr 7, 2010 at 7:53 PM, Jens Alfke  wrote:

> I think the Finder only knows that because it's the one doing the copying.
> If something else is copying a file (like the 'cp' command) the Finder
> doesn't gray out the file.

But I think what is happening is there is an FSEvent when the
placeholder file is created at the destination. This file has a file
size of 0 bytes. When the file is finished being written the file is
swapped out with the placeholder file. This raises a 2nd FSEvent.
Reading the file size on the second event shows the full file size.

It looks to me like 'cp' doesn't show the file at all until it is
finished writing.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


SFAuthorization bug / crash

2010-04-07 Thread Seth Willits
Hi guys,


Strange crash. It happens for one user "on a couple 10.5 machines." 
objc_assign_strongCast seems to be GC related, but I'm not using GC. 

It seems that maybe this is a 10.5 bug where initWithFlags:rights:environment: 
is returning junk?


Any ideas?



/*
OS Version:  Mac OS X 10.5.8 (9L31a)
Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x
Crashed Thread:  0

Thread 0 Crashed:
0   ??? 0xa0565027 objc_assign_strongCast + 9
1   com.apple.securityfoundation0x9770343b -[SFAuthorization 
obtainWithRight:flags:error:] + 163
2   ...iumgroup.AraeliumFoundation  0x00094413 -[AGAuthentication 
authorization] + 183
*/


- (SFAuthorization *)authorization;
{
if (!mAuthorization) {
AuthorizationFlags flags = kAuthorizationFlagDefaults | 
kAuthorizationFlagExtendRights | kAuthorizationFlagInteractionAllowed;
AuthorizationItem item = {kAuthorizationRightExecute, 0, 0, 0}; // 
system.privilege.admin
AuthorizationRights rights = {1, &item};

mAuthorization = [[SFAuthorization alloc] initWithFlags:flags 
rights:&rights environment:kAuthorizationEmptyEnvironment];

if (![mAuthorization obtainWithRight:kAuthorizationRightExecute 
flags:flags error:nil]) {
[mAuthorization release];
mAuthorization = nil;
}
}

return mAuthorization;
}




--
Seth Willits


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Character Map

2010-04-07 Thread Greg Guerin

Ian was here wrote:

Does anyone know to programmatically bring up the special  
characters panel that TextEdit shows when you select the "Special  
Characters..." item in the Edit menu?



Paste into Terminal:

open -a CharPaletteServer

Should be able to work out the rest from that.

  -- GG

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Character Map

2010-04-07 Thread David Duncan
On Apr 7, 2010, at 4:28 PM, Ian was here wrote:

> Does anyone know to programmatically bring up the special characters panel 
> that TextEdit shows when you select the "Special Characters..." item in the 
> Edit menu?


[[NSApplication sharedApplication] orderFrontCharacterPalette:nil];
--
David Duncan
Apple DTS Animation and Printing

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Reordered columns and [tableView editColumn:0 row:ind withEvent:nil select:YES];

2010-04-07 Thread Chris Idou


I've got some code that uses editColumn:0 to force the user into edit mode on 
the first column.

But I've noticed that if user column reordering is allowed, this no longer 
edits the correct column. This seems odd to me because I thought Cocoa pretty 
much shielded the programmer from all the user reordering stuff.

Even more oddly, if the user puts a checkbox as the first column, the checkbox 
seems to start behaving like a text box, albeit with invisible characters. 
Could I be doing something wrong, or is this some kind of bug? And do I have to 
somehow translate column 0 to find out the real column? I know Java tables have 
methods to translate between model and view column numbers because of user 
reordering, but I haven't noticed such a thing in Cocoa.




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Reordered columns and [tableView editColumn:0 row:ind withEvent:nil select:YES];

2010-04-07 Thread Graham Cox

On 08/04/2010, at 11:46 AM, Chris Idou wrote:

> 
> 
> I've got some code that uses editColumn:0 to force the user into edit mode on 
> the first column.
> 
> But I've noticed that if user column reordering is allowed, this no longer 
> edits the correct column. This seems odd to me because I thought Cocoa pretty 
> much shielded the programmer from all the user reordering stuff.
> 
> Even more oddly, if the user puts a checkbox as the first column, the 
> checkbox seems to start behaving like a text box, albeit with invisible 
> characters. Could I be doing something wrong, or is this some kind of bug? 
> And do I have to somehow translate column 0 to find out the real column? I 
> know Java tables have methods to translate between model and view column 
> numbers because of user reordering, but I haven't noticed such a thing in 
> Cocoa.


Yes, you're doing something wrong. You are assuming that column 0 is always a 
specific column, which because of user reordering, is not the case.

Instead of hard-coding 0 as the index of the column, look up its index by 
[NSTableView columnWithIdentifier:@"foo"]; The identifier is what identifies 
the column, not its index, so you have to look up the index dynamically.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Character Map

2010-04-07 Thread Ian was here
Beautiful! Thanks.


--- On Wed, 4/7/10, David Duncan  wrote:

From: David Duncan 
Subject: Re: Character Map
To: "Ian was here" 
Cc: "Apple Developer Mailing List" 
Date: Wednesday, April 7, 2010, 5:40 PM

On Apr 7, 2010, at 4:28 PM, Ian was here wrote:
Does anyone know to programmatically bring up the special characters panel that 
TextEdit shows when you select the "Special Characters..." item in the Edit 
menu?

[[NSApplication sharedApplication] orderFrontCharacterPalette:nil];

--David DuncanApple DTS Animation and Printing






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Chase Meadors
I must confess, the framework sounds great. However, I'm a little new  
at this, especially open-source. I can't seem to sort out from Apple's  
guide on building open source binaries exactly how to do it. Could you  
give or direct me to a guide on what exactly I need to do to get the  
framework in Xcode and ready to use in my project?


On Apr 7, 2010, at 3:54 AM, patrick machielse wrote:

Op 6 apr 2010, om 17:22 heeft cocoa-dev-requ...@lists.apple.com het  
volgende geschreven:


I've been searching google for a while, and have repeatedly  
stumbled across mention of an Objective-C ID3 framework constantly  
linked to


http://drewfamily.homemail.com.au/Cocoa_-_ID3Tag_framework.html


Don't use that, it is no longer up to date. It was a valiant attempt  
at ID3 support, but it doesn't adhere to the ID3 specifications very  
well and it stumbles on real world tags more often than other  
solutions do.


I can recommend TagLib:
http://developer.kde.org/~wheeler/taglib.html

It uses a C++ API, but it is quite easy to use. Rolling it into a OS  
X framework is easy (Google it). TagLib adheres strictly to the ID3  
standard but by default it uses workarounds for the instances when  
iTunes doesn't... It is also very stable, actively developed, it's  
covered by a usable license (lgpl), supports more tags than just  
ID3, and there's a development mailing list. What more do you want?


patrick
--
Patrick Machielse
Hieper Software

http://www.hieper.nl
i...@hieper.nl



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Problem with vCard and AddressBook ABPerson UID, HELP!!

2010-04-07 Thread Eric Giguere
Hi all

I've been fighting now with the AdressBook API for a while and found a 
disturbing problem. Maybe someone can help.

I'm trying to use the AddressBook as my main person "database" in my 
application. I've create a small function that accepts drag - drops from the 
Address book to add a new person in my app. So far so good.

I'm trying after to show in my application details about that linked person and 
that's where everything falls down.

On drop, I read the vCard created by the AddressBook using this line:

ABPerson* aPerson = [[ABPerson alloc] initWithVCardRepresentation:filedata];

When doing this, the UID of my person gets re-generated. I wanted to use the 
UID as my reference to my original address book record and dig the information 
using it. But since its re-generated upon read of the vCard, no luck. So the 
call:
ABAddressBook* addressBook = [ABAddressBook addressBook];
ABRecord* abRecord = [addressBook recordForUniqueId:personId];

always return null. 
But, if I use the sharedAddressBook instead, my UIDs still get re-generated but 
this guy (the sharedAddressBook) can find the records but only in the same 
execution of the application. Upon restart, same old no-match problem.

There must be something i REALLY don't understand about the AB but can't find 
anything more, out of ideas.

Anybody knows what's going on? Any way we can prevent my vCard initialization 
from re-genrating the UID? If not, then what would be the correct way to refer 
to AB records from another application? Running a search based on names sounds 
bad compared to using direct pointers to records, the UID.

Thank you !
Eric.




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How does Finder determine when a file is busy being written to the disk?

2010-04-07 Thread Jens Alfke
That may be true, but it's not directly related to the Finder graying out the 
source file. As I said, it grays out the file when it itself starts copying it. 
It has no way of telling when some other process is doing the copy. 

--Jens {via iPad}

On Apr 7, 2010, at 5:16 PM, Lee Gillen  wrote:

> On Wed, Apr 7, 2010 at 7:53 PM, Jens Alfke  wrote:
> 
>> I think the Finder only knows that because it's the one doing the copying.
>> If something else is copying a file (like the 'cp' command) the Finder
>> doesn't gray out the file.
> 
> But I think what is happening is there is an FSEvent when the
> placeholder file is created at the destination. This file has a file
> size of 0 bytes. When the file is finished being written the file is
> swapped out with the placeholder file. This raises a 2nd FSEvent.
> Reading the file size on the second event shows the full file size.
> 
> It looks to me like 'cp' doesn't show the file at all until it is
> finished writing.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Jens Alfke
Check the README file for instructions on building it. If there's a way to 
build it into a dynamic library, do that (most likely through some 'make' 
command). Then you can add that library file to your Xcode project.

--Jens {via iPad}

On Apr 7, 2010, at 8:03 PM, Chase Meadors  wrote:

> I must confess, the framework sounds great. However, I'm a little new at 
> this, especially open-source. I can't seem to sort out from Apple's guide on 
> building open source binaries exactly how to do it. Could you give or direct 
> me to a guide on what exactly I need to do to get the framework in Xcode and 
> ready to use in my project?
> 
> On Apr 7, 2010, at 3:54 AM, patrick machielse wrote:
> 
>> Op 6 apr 2010, om 17:22 heeft cocoa-dev-requ...@lists.apple.com het volgende 
>> geschreven:
>> 
>>> I've been searching google for a while, and have repeatedly stumbled across 
>>> mention of an Objective-C ID3 framework constantly linked to
>>> 
>>> http://drewfamily.homemail.com.au/Cocoa_-_ID3Tag_framework.html
>> 
>> Don't use that, it is no longer up to date. It was a valiant attempt at ID3 
>> support, but it doesn't adhere to the ID3 specifications very well and it 
>> stumbles on real world tags more often than other solutions do.
>> 
>> I can recommend TagLib:
>> http://developer.kde.org/~wheeler/taglib.html
>> 
>> It uses a C++ API, but it is quite easy to use. Rolling it into a OS X 
>> framework is easy (Google it). TagLib adheres strictly to the ID3 standard 
>> but by default it uses workarounds for the instances when iTunes doesn't... 
>> It is also very stable, actively developed, it's covered by a usable license 
>> (lgpl), supports more tags than just ID3, and there's a development mailing 
>> list. What more do you want?
>> 
>> patrick
>> --
>> Patrick Machielse
>> Hieper Software
>> 
>> http://www.hieper.nl
>> i...@hieper.nl
>> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/jens%40mooseyard.com
> 
> This email sent to j...@mooseyard.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


IB Parses Class Names?

2010-04-07 Thread Patrick M. Rutkowski
I find it odd that the following happens:

In IB, go to Tools->Library, find the generic NSObject thing, and
place one into the nib file's object pool. Then go to
Tools->Inspector, find the identity inspector, and change the object's
class name from "NSObject" to something like "GPSManager."

Once you've done that, you'll notice that in the object pool the item
in question will now be called "Manager." Apparently IB thought that
the "GPS*" part was a prefix, and it threw it away. My project prefix
for most things is "IC", so I made that "ICGPSManager" instead, but
then it though that the whole of "ICGPS*" was the prefix, and threw
that all away instead, so no luck.

If I change it to just "GpsManager" or "ICGpsManager" then it works
properly, but feels wrong with the lower case.

Is there a way to turn this IB feature off?

Just a small annoyance,
-Patrick
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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

2010-04-07 Thread Roy Lovejoy

Hi:
I am getting this message.
Using two-stage rotation animation. To use the smoother single- 
stage animation, this application must remove two-stage method  
implementations.




I'm getting this message on a brand-new (created with 3.2 SDK) Tab  
project-


there are *NO* two stage methods anywhere in the project, and in the 3  
UIViewControllers subclasses I had only


shouldAutorotateToInterfaceOrientation:, and it did the console spew..

I then added willAnimateRotationToInterfaceOrientation:duration: and  
it still did it-


so..

iPhone Tab template project no two-stage rotation console 
spew

iPhone Tab template project +
shouldAutorotateToInterfaceOrientation: two-stage rotation console spew

iPhone Tab template project +
shouldAutorotateToInterfaceOrientation:	+	two-stage rotation console  
spew

willAnimateRotationToInterfaceOrientation:duration:

something *else* is going on
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Core Data: binding to a sum

2010-04-07 Thread David Catmull
On Apr 7, 2010, at 10:19 AM, Keary Suska wrote:
> On Apr 7, 2010, at 9:14 AM, David Catmull wrote:
>> ..so I take it the particular NSSet variant used by Core Data doesn't 
>> support observing @sum. Or did I do that wrong?
> 
> Yes, because you are trying to observe an element of a set. Same goes for 
> arrays. Instead, add an array controller whose content is bound to "items", 
> and bind to arrangedObjects->@sum.limit.


Thanks! I'm used to just thinking of array controllers as a way to feed table 
views. This did the trick.

David Catmull
uncom...@uncommonplace.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: IB Parses Class Names?

2010-04-07 Thread Kyle Sluder
On Apr 7, 2010, at 3:44 PM, "Patrick M. Rutkowski"  
 wrote:



Is there a way to turn this IB feature off?


No. Just give the object a name. Much better than having a bunch of  
nameless Custom Objects floating around.


--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Chase Meadors
I went into the directory and ran configure and make. Everything looks  
like it went okay, but what file am I looking for?


On Apr 7, 2010, at 10:28 PM, Jens Alfke wrote:

Check the README file for instructions on building it. If there's a  
way to build it into a dynamic library, do that (most likely through  
some 'make' command). Then you can add that library file to your  
Xcode project.


--Jens {via iPad}

On Apr 7, 2010, at 8:03 PM, Chase Meadors   
wrote:


I must confess, the framework sounds great. However, I'm a little  
new at this, especially open-source. I can't seem to sort out from  
Apple's guide on building open source binaries exactly how to do  
it. Could you give or direct me to a guide on what exactly I need  
to do to get the framework in Xcode and ready to use in my project?


On Apr 7, 2010, at 3:54 AM, patrick machielse wrote:

Op 6 apr 2010, om 17:22 heeft cocoa-dev-requ...@lists.apple.com  
het volgende geschreven:


I've been searching google for a while, and have repeatedly  
stumbled across mention of an Objective-C ID3 framework  
constantly linked to


http://drewfamily.homemail.com.au/Cocoa_-_ID3Tag_framework.html


Don't use that, it is no longer up to date. It was a valiant  
attempt at ID3 support, but it doesn't adhere to the ID3  
specifications very well and it stumbles on real world tags more  
often than other solutions do.


I can recommend TagLib:
http://developer.kde.org/~wheeler/taglib.html

It uses a C++ API, but it is quite easy to use. Rolling it into a  
OS X framework is easy (Google it). TagLib adheres strictly to the  
ID3 standard but by default it uses workarounds for the instances  
when iTunes doesn't... It is also very stable, actively developed,  
it's covered by a usable license (lgpl), supports more tags than  
just ID3, and there's a development mailing list. What more do you  
want?


patrick
--
Patrick Machielse
Hieper Software

http://www.hieper.nl
i...@hieper.nl



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jens%40mooseyard.com

This email sent to j...@mooseyard.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Jens Alfke

On Apr 7, 2010, at 8:37 PM, Chase Meadors wrote:

> I went into the directory and ran configure and make. Everything looks like 
> it went okay, but what file am I looking for?

It depends. All projects are different. Did it create a “bin” or “lib” 
subdirectory? (Did you check the readme file or other docs?)
Often, if you do a “sudo make install” it will put libraries into system 
library directories, like /usr/local/lib.

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Martin Hewitson

On Apr 7, 2010, at 10:50 PM, Ross Carter wrote:

> On Apr 7, 2010, at 11:52 AM, Martin Hewitson  
> wrote:
> 
>> Hi Kyle,
>> 
>> At the moment it does nothing but call super. I was using it to handle 
>> line-wrapping, but in the process of debugging this problem it's reduced to
>> 
>> - (void)insertText:(id)aString
>> {
>>  [super insertText:aString];
>> }
> 
> I would set a breakpoint here and examine a description of the textStorage 
> and the layoutManager. Also, are you creating the NSTextStorage from an empty 
> string? Nil? Or possibly some other value?

Sometimes the NSTextStorage is created from an empty string, sometimes not. In 
the case the string is empty, I get the exceptions. If the string is not empty, 
I don't get the exceptions. A single whitespace character in the string is 
enough to stop the exceptions.

Martin

> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de
> 
> This email sent to martin.hewit...@aei.mpg.de


Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Chase Meadors
I ran sudo make install, and it appears to have installed everything  
in usr/local/include/taglib. Is that it? Am I ready to #include these  
files in an Xcode project? What exactly do I #include? filename>? Sorry for all the questions, but you've been a lot of help.


On Apr 7, 2010, at 10:43 PM, Jens Alfke wrote:



On Apr 7, 2010, at 8:37 PM, Chase Meadors wrote:

I went into the directory and ran configure and make. Everything  
looks like it went okay, but what file am I looking for?


It depends. All projects are different. Did it create a “bin” or  
“lib” subdirectory? (Did you check the readme file or other docs?)
Often, if you do a “sudo make install” it will put libraries into  
system library directories, like /usr/local/lib.


—Jens


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


re: Problem with vCard and AddressBook ABPerson UID, HELP!!

2010-04-07 Thread Ben Trumbull
> 've been fighting now with the AdressBook API for a while and found a 
> disturbing problem. Maybe someone can help.
> 
> I'm trying to use the AddressBook as my main person "database" in my 
> application. I've create a small function that accepts drag - drops from the 
> Address book to add a new person in my app. So far so good.
> 
> I'm trying after to show in my application details about that linked person 
> and that's where everything falls down.
> 
> On drop, I read the vCard created by the AddressBook using this line:
> 
> ABPerson* aPerson = [[ABPerson alloc] initWithVCardRepresentation:filedata];

That always creates a brand new contact with a brand new uniqueID.  As you 
observe.  I'm pretty sure it's not an appropriate way to pass around a 
*reference* to an existing contact.  That's what -[ABRecord uniqueId] is for.  
You should get the uniqueId, pass that around, and then use -[ABAddressBook 
recordForUniqueId:] to look up the contact.

- Ben

> 
> When doing this, the UID of my person gets re-generated. I wanted to use the 
> UID as my reference to my original address book record and dig the 
> information using it. But since its re-generated upon read of the vCard, no 
> luck. So the call:
>   ABAddressBook* addressBook = [ABAddressBook addressBook];
>   ABRecord* abRecord = [addressBook recordForUniqueId:personId];
> 
> always return null. 
> But, if I use the sharedAddressBook instead, my UIDs still get re-generated 
> but this guy (the sharedAddressBook) can find the records but only in the 
> same execution of the application. Upon restart, same old no-match problem.
> 
> There must be something i REALLY don't understand about the AB but can't find 
> anything more, out of ideas.
> 
> Anybody knows what's going on? Any way we can prevent my vCard initialization 
> from re-genrating the UID? If not, then what would be the correct way to 
> refer to AB records from another application? Running a search based on names 
> sounds bad compared to using direct pointers to records, the UID.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to subclass UIButton?

2010-04-07 Thread john chen
I think UIButton is not designed for subclassing. You can try
composition, or create UIButton category method for custom-build
button. Apple has sample code in UICatalog to create custom-build
button.

On Wed, Apr 7, 2010 at 2:26 PM, WT  wrote:
> Hello all,
>
> I need to create a custom bar of UIButton instances which can be scrolled 
> left and right using a swipe gesture. I am thus following the "Autoscroll" 
> sample code from Apple, which subclasses UIImageView to produce a scrollable 
> bar of thumbnail images. My problem is how to correctly subclass UIButton, 
> since the only available means of instantiating a button is through the class 
> method +buttonWithType:.
>
> Once I allocate an instance of the subclass, how do I initialize it with the 
> desired type? The buttonType property is read-only and there is no instance 
> method -initWithType: in the public API.
>
> One alternative I see is to use composition rather than subclassing, 
> essentially creating a decorator for UIButton, but I'd rather not have to do 
> that.
>
> Another option is to fake a button using UIImageView, just like the 
> "Autoscroll" example does, but I'd prefer to have actual UIButton instances.
>
> Am I missing something trivial here? If UIButton was designed in such a way 
> to prevent subclassing, what would you suggest as the best alternative?
>
> Thanks in advance.
> WT.___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/johnchen202%40gmail.com
>
> This email sent to johnchen...@gmail.com
>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Problem with vCard and AddressBook ABPerson UID, HELP!!

2010-04-07 Thread Jens Alfke

>> I'm trying to use the AddressBook as my main person "database" in my 
>> application. I've create a small function that accepts drag - drops from the 
>> Address book to add a new person in my app. So far so good.
>> 
>> I'm trying after to show in my application details about that linked person 
>> and that's where everything falls down.
>> 
>> On drop, I read the vCard created by the AddressBook using this line:
>> 
>> ABPerson* aPerson = [[ABPerson alloc] initWithVCardRepresentation:filedata];

It’s been a long time since I did this, but IIRC you don’t want to use the 
vCard data on the pasteboard. There’s another data flavor put there by AB that 
contains the cards UID, I think. Try getting the PasteboardPeeker app [it’s 
Apple sample code] and dragging from AB.app into it, to see what all the data 
types are.

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Jens Alfke

On Apr 7, 2010, at 9:05 PM, Chase Meadors wrote:

> I ran sudo make install, and it appears to have installed everything in 
> usr/local/include/taglib. Is that it?

Those are the headers. The actual library itself must be somewhere else. (Check 
/usr/local/lib.)

You’d need to add /usr/local/include as a header search path in your Xcode 
target, and then you could #include . But you’ll get link errors 
unless you actually add the library to the project.

—Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to subclass UIButton?

2010-04-07 Thread WT
On Apr 8, 2010, at 6:44 AM, john chen wrote:

> I think UIButton is not designed for subclassing.

That was my hunch as well.

> You can try
> composition, or create UIButton category method for custom-build
> button. Apple has sample code in UICatalog to create custom-build
> button.

A category on UIButton won't work for me because I need to add extra state to 
the custom button. The best alternative I've come up with is to have a custom 
UIView object that contains a UIButton instance and which hijacks touch events 
by overriding -hitTest:withEvent: to return self. Once the swiping and 
reordering (as in the Autoscroll sample code) have been dealt with, this 
"proxy" UIView instance can decide if/when to forward a tap gesture to the 
button. So, yes, composition seems to be the way to go here.

> On Wed, Apr 7, 2010 at 2:26 PM, WT wrote:
>> Hello all,
>> 
>> I need to create a custom bar of UIButton instances which can be scrolled 
>> left and right using a swipe gesture. I am thus following the "Autoscroll" 
>> sample code from Apple, which subclasses UIImageView to produce a scrollable 
>> bar of thumbnail images. My problem is how to correctly subclass UIButton, 
>> since the only available means of instantiating a button is through the 
>> class method +buttonWithType:.
>> 
>> Once I allocate an instance of the subclass, how do I initialize it with the 
>> desired type? The buttonType property is read-only and there is no instance 
>> method -initWithType: in the public API.
>> 
>> One alternative I see is to use composition rather than subclassing, 
>> essentially creating a decorator for UIButton, but I'd rather not have to do 
>> that.
>> 
>> Another option is to fake a button using UIImageView, just like the 
>> "Autoscroll" example does, but I'd prefer to have actual UIButton instances.
>> 
>> Am I missing something trivial here? If UIButton was designed in such a way 
>> to prevent subclassing, what would you suggest as the best alternative?
>> 
>> Thanks in advance.
>> WT.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[SOLVED]: Re: exceptions when NSTextStorage initialized with empty string

2010-04-07 Thread Martin Hewitson
OK, bug found. 

A really silly mistake on my part but I think it's worth reporting in case it 
saves someone else a headache. 

My NSTextView subclass has syntax coloring which is called on receipt of 
NSTextStorageDidProcessEditingNotification.

In the method that does the coloring, I had the following:


[[self textStorage] beginEditing];

[self setTextColor:textColor range:r];

// do other coloring stuff by setting attributes on the NSTextStorage, 
e.g.,
[[self textStorage] addAttribute:NSForegroundColorAttributeName 
value:commentColor range:commRange];

// . other stuff

[[self textStorage] endEditing];


So I think it is a bad thing to make calls to NSTextView methods which change 
the text in between calls to begin/endEditing. So moving the setTextColor: call 
above beginEditing fixes the problem.

I still don't understand why it is depending on initializing the text storage 
with an empty string or not. Still some head scratching to do, I think.

Martin




On Apr 8, 2010, at 5:57 AM, Martin Hewitson wrote:

> 
> On Apr 7, 2010, at 10:50 PM, Ross Carter wrote:
> 
>> On Apr 7, 2010, at 11:52 AM, Martin Hewitson  
>> wrote:
>> 
>>> Hi Kyle,
>>> 
>>> At the moment it does nothing but call super. I was using it to handle 
>>> line-wrapping, but in the process of debugging this problem it's reduced to
>>> 
>>> - (void)insertText:(id)aString
>>> {
>>> [super insertText:aString];
>>> }
>> 
>> I would set a breakpoint here and examine a description of the textStorage 
>> and the layoutManager. Also, are you creating the NSTextStorage from an 
>> empty string? Nil? Or possibly some other value?
> 
> Sometimes the NSTextStorage is created from an empty string, sometimes not. 
> In the case the string is empty, I get the exceptions. If the string is not 
> empty, I don't get the exceptions. A single whitespace character in the 
> string is enough to stop the exceptions.
> 
> Martin
> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de
>> 
>> This email sent to martin.hewit...@aei.mpg.de
> 
> 
> Martin Hewitson
> Albert-Einstein-Institut
> Max-Planck-Institut fuer 
>Gravitationsphysik und Universitaet Hannover
> Callinstr. 38, 30167 Hannover, Germany
> Tel: +49-511-762-17121, Fax: +49-511-762-5861
> E-Mail: martin.hewit...@aei.mpg.de
> WWW: http://www.aei.mpg.de/~hewitson
> 
> 
> 
> 
> 
> 


Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to subclass UIButton?

2010-04-07 Thread Jack Nutting
I've successfully subclassed UIButton with no problems.  I my case I
wasn't interested in the "style" since I was implementing my own, so I
created my own class method which just calls initWithFrame:

+ (id)buttonWithFrame:(CGRect)frame {
  return [[[self alloc] initWithFrame:frame] autorelease];
}

- (id)initWithFrame:(CGRect)frame {
  if (self = [super initWithFrame:frame]) {
// do my additional initialization here
  }
  return self;
}

Note that this way the buttonType isn't explicitly set to anything,
which probably means that it's UIButtonTypeCustom.  The Docs don't
seem to actually specify that, but since that's the 0 value in the
enum, that's likely what happens (and that seems to be the observable
behavior as well)

If you want to use the existing buttonWithStyle: method, all you need
to do is implement initWithFrame:, since that's the default
initializer, then call [MyButton buttonWithStyle:whatever] and you're
done!

If you also want to be able to use your subclass in .xib files, then
you'll also need to implement initWithCoder: (calling the super
implementation) and put your initialization code in there as well.

-- 
// jack
// http://nuthole.com
// http://learncocoa.org
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How to subclass UIButton?

2010-04-07 Thread WT
> If you want to use the existing buttonWithStyle: method, all you need
> to do is implement initWithFrame:, since that's the default
> initializer

Is the fact that -initWithFrame: is the designated initializer documented 
anywhere? The docs for UIButton don't mention it. If this is documented and/or 
won't change, then it's the solution I've been looking for.

Thanks!

On Apr 8, 2010, at 8:14 AM, Jack Nutting wrote:

> I've successfully subclassed UIButton with no problems.  I my case I
> wasn't interested in the "style" since I was implementing my own, so I
> created my own class method which just calls initWithFrame:
> 
> + (id)buttonWithFrame:(CGRect)frame {
>  return [[[self alloc] initWithFrame:frame] autorelease];
> }
> 
> - (id)initWithFrame:(CGRect)frame {
>  if (self = [super initWithFrame:frame]) {
>// do my additional initialization here
>  }
>  return self;
> }
> 
> Note that this way the buttonType isn't explicitly set to anything,
> which probably means that it's UIButtonTypeCustom.  The Docs don't
> seem to actually specify that, but since that's the 0 value in the
> enum, that's likely what happens (and that seems to be the observable
> behavior as well)
> 
> If you want to use the existing buttonWithStyle: method, all you need
> to do is implement initWithFrame:, since that's the default
> initializer, then call [MyButton buttonWithStyle:whatever] and you're
> done!
> 
> If you also want to be able to use your subclass in .xib files, then
> you'll also need to implement initWithCoder: (calling the super
> implementation) and put your initialization code in there as well.
> 
> -- 
> // jack
> // http://nuthole.com
> // http://learncocoa.org

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Query on File Wrapping

2010-04-07 Thread Swetha Chinthireddy
Hi ,

Our application needs to log trace messages to a file for troubleshooting  .

Currently once the file size reaches 10MB , we are creating a new file and 
copying the last 4KB messages to the new file.But the requirement is to wrap 
the file i.e  to always keep the latest 10MB traces.

Any inputs in this regard.




Thanks,
Swetha

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com