[SOLVED] Drag from Table To View

2010-09-25 Thread koko
This began to work when I changed the base class and initializer for  
the table cell from NSCell and -init to NSTextFieldCell and - 
initTextCell.


-koko


On Sep 25, 2010, at 6:51 PM, k...@highrolls.net wrote:




Begin forwarded message:


From: k...@highrolls.net
Date: September 25, 2010 6:45:21 PM MDT
To: Seth Willits 
Subject: Re: Drag from Table To View

Well thank you Seth, you are correct.

I should have said that


- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes: 
(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard



is never called. And as I understood only this method and this

	[self registerForDraggedTypes:[NSArray  
arrayWithObject:@"Obstacles"]];


need to be implemented / called for a drag session to start from a  
table.




On Sep 25, 2010, at 5:55 PM, Seth Willits wrote:


On Sep 25, 2010, at 1:43 PM, k...@highrolls.net wrote:


But, It don't work so what now brown cow?


Try to never say "it doesn't work." Explain *how* it doesn't work.  
Half the time you'll answer the question yourself.



--
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/koko 
%40highrolls.net


This email sent to k...@highrolls.net





___

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/koko%40highrolls.net

This email sent to k...@highrolls.net



___

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


[ANN] AppKiDo 0.985

2010-09-25 Thread Andy Lee


This should fix the problems at least some folks have been having with the iOS 
4.1 SDK.  It also includes bug fixes from the two 985 sneakypeeks.

Many thanks to Gerriet Denkmann for finding and fixing the bug.

Any problems (for example, I've only tested on Snow Leopard), please let me 
know.

--Andy

___

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: Garbage collection 32 & 64-bit

2010-09-25 Thread John C. Randolph


On Sep 14, 2010, at 7:34 AM, Jonathan Guy wrote:


Hi all
Having an issue with GC. I compile an app 32 & 64-bit intel only  
with GC supported (not required). The app has a webview which loads  
a flash animation (hence requiring the flash plugin).


Does it have to be a flash animation?  Could it be done with HTML 5 or  
Quartz Composer instead?


-jcr
___

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


Three problems with CATiledLayer on 10.5

2010-09-25 Thread Gideon King
Hi All, I've run into three fairly basic problems with using CATiledLayer on 
10.5. All of these things work fine in 10.6, but unfortunately I have to 
support 10.5 too. It is a layer hosting view in a scrollview, with a layer that 
is a CATiledLayer.

1. When my CATiledLayer is 5,000 x 5,000 pixels, it doesn't draw, but at 2,000 
x 2,000 it does. In my application, 5,000 x 5,000 would be reasonably common. 
How do I get it to work with larger sizes like this?

2. I want to do all the drawing in a flipped coordinate space, but if I do 
either 
[holderLayer setAffineTransform:CGAffineTransformMakeScale(1.0f, 
-1.0f)];
or
holderLayer.transform = CATransform3DMakeScale(1.0f, -1.0f, 1.0f);
It stops drawing completely. How do I flip my coordinates?

3. I want to have the center of the coordinates at the center of the layer, so 
I set the bounds origin to negative half the width/height, but when I do that, 
my background fill which just fills the bounds doesn't draw, and my tiled image 
drawn with CGContextDrawTiledImage only draws the image for a brief moment when 
you scroll the view. How do I move the bounds origin?


Thanks

Gideon





___

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


Fwd: Drag from Table To View

2010-09-25 Thread koko



Begin forwarded message:


From: k...@highrolls.net
Date: September 25, 2010 6:45:21 PM MDT
To: Seth Willits 
Subject: Re: Drag from Table To View

Well thank you Seth, you are correct.

I should have said that


 - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes: 
(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard



is never called. And as I understood only this method and this

	[self registerForDraggedTypes:[NSArray  
arrayWithObject:@"Obstacles"]];


need to be implemented / called for a drag session to start from a  
table.




On Sep 25, 2010, at 5:55 PM, Seth Willits wrote:


On Sep 25, 2010, at 1:43 PM, k...@highrolls.net wrote:


But, It don't work so what now brown cow?


Try to never say "it doesn't work." Explain *how* it doesn't work.  
Half the time you'll answer the question yourself.



--
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/koko%40highrolls.net

This email sent to k...@highrolls.net





___

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: Class Instance Storage

2010-09-25 Thread Richard Somers

On Sep 25, 2010, at 5:25 PM, Kyle Sluder wrote:

Usually the better approach is to pick a time at which it makes  
sense to remove the object from the array. ... We have a few of  
these, and typically call them -invalidate.


I revised my class to incorporate an 'invalidate' method and call it  
as you suggested. Works like a charm.


Thank you so much.

--Richard

___

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: Drag from Table To View

2010-09-25 Thread Seth Willits
On Sep 25, 2010, at 1:43 PM, k...@highrolls.net wrote:

> But, It don't work so what now brown cow?

Try to never say "it doesn't work." Explain *how* it doesn't work. Half the 
time you'll answer the question yourself.


--
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: Class Instance Storage

2010-09-25 Thread Kyle Sluder
On Sep 25, 2010, at 3:31 PM, Richard Somers  wrote:

> I need a class, in which an instance of the class, can access all other 
> instances of the class.
> 
> In the following code, instances of the class are stored in a static mutable 
> array. To make the code work, the instance must released after adding it to 
> the array and retained before removing it from the array. Otherwise dealloc 
> will never be called, and instances will never be removed from the array.

Usually the better approach is to pick a time at which it makes sense to remove 
the object from the array. For example, if you were writing a socket wrapper 
class and needed to keep a global array of all socket objects, you might add 
the object to the array in -init, and remove it in -close.

If you can't find a good method to use, I'd advise adding one specifically for 
this purpose. We have a few of these, and typically call them -invalidate. As 
long as everyone plays by the memory management rules, no overrides of -retain 
or -release are required, and calling -invalidate breaks the retain cycle that 
would otherwise keep the object alive.

I would not recommend playing fancy memory management tricks in -init or 
-dealloc. You're likely to make a mistake (memory management is a noodly enough 
topic already), and they will make your code more confusing in a garbage 
collected environment.

--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


Class Instance Storage

2010-09-25 Thread Richard Somers
I need a class, in which an instance of the class, can access all  
other instances of the class.


In the following code, instances of the class are stored in a static  
mutable array. To make the code work, the instance must released after  
adding it to the array and retained before removing it from the array.  
Otherwise dealloc will never be called, and instances will never be  
removed from the array.


// MyClass.m

static NSMutableArray *_array;

@implementation MyClass

+ (void)initialize
{
_array = [[NSMutableArray array] retain]; // Is retain correct  
here?

}

- (id)init
{
self = [super init];
if (self) {
[_array addObject:self];
[self release]; // ???
}
return self;
}

- (void)dealloc
{
[self retain]; // ???
[_array removeObject:self];

[super dealloc];
}

@end

This code seems to work fine. Is there a better way to do this?

--Richard

___

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


Drag from Table To View

2010-09-25 Thread koko
Earlier this I got help on dragging from  NSView to NSView .. got it  
working just fine.


Made some changes and want to drag from a Table to the same view I had  
accepting drops previously.


I do this in my table sub class awakeFromNib

[self registerForDraggedTypes:[NSArray arrayWithObject:@"Obstacles"]];

and I implement

- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes: 
(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {



NSLog(@"writeRowsWithIndexes %@", rowIndexes);

	NSData *zNSIndexSetData = [NSKeyedArchiver  
archivedDataWithRootObject:rowIndexes];
	[pboard declareTypes:[NSArray arrayWithObject:@"Obstacles"]  
owner:self];

[pboard setData:zNSIndexSetData forType:@"Obstacles"];

return YES;
}


which as I understand the docs is all that is required to have a table  
as a drag source.


But, It don't work so what now brown cow?

Thanks -koko
___

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: In-app SMS

2010-09-25 Thread Mark Woollard
My understanding is that although you can compose an SMS with multiple 
recipients in iOS 4.0 ready for sending the user still has to interact and 
touch the actual send button on the compose screen. An app cannot send SMS 
messages without the user being involved and having the chance to approve both 
the recipients and the message contents.

Mark

On 25 Sep 2010, at 15:11, Fritz Anderson wrote:

> On 25 Sep 2010, at 1:10 PM, Dan Hopwood wrote:
> 
>> I found the following link with info on how to send SMSs from within an
>> application.
>> 
>> http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/
>> 
>> I have not tested this yet but have the following question. If the above
>> does work, do Apple allow applications onto the App Store that use such a
>> technique or does it depend on the context. For example, it would make sense
>> that Apple reject an application that spams the users contacts on every
>> launch but perhaps not for an app that replies on sending SMSs for it's
>> purpose.
> 
> The fact that Apple provides a public API for composing and sending SMS 
> messages would suggest that they permit apps to use it.
> 
> As for your particular use, the approval process is less opaque than it had 
> been, but the only definitive guidance on what Apple will do is whatever 
> Apple does. They have published their guidelines; they're behind an ADC 
> login, so I won't try to guess at the answer to your question (and a good 
> thing, too), but you can get at them from
> 
> 
> 
> If it were me (speaking only as to what I think is reasonable and fair), I 
> wouldn't send an SMS except on the express permission of the user, every 
> time, and at least offering to show the full text of the message, every time.
> 
>   — 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/mark.woollard%40mac.com
> 
> This email sent to mark.wooll...@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


Re: In-app SMS

2010-09-25 Thread Fritz Anderson
On 25 Sep 2010, at 1:10 PM, Dan Hopwood wrote:

> I found the following link with info on how to send SMSs from within an
> application.
> 
> http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/
> 
> I have not tested this yet but have the following question. If the above
> does work, do Apple allow applications onto the App Store that use such a
> technique or does it depend on the context. For example, it would make sense
> that Apple reject an application that spams the users contacts on every
> launch but perhaps not for an app that replies on sending SMSs for it's
> purpose.

The fact that Apple provides a public API for composing and sending SMS 
messages would suggest that they permit apps to use it.

As for your particular use, the approval process is less opaque than it had 
been, but the only definitive guidance on what Apple will do is whatever Apple 
does. They have published their guidelines; they're behind an ADC login, so I 
won't try to guess at the answer to your question (and a good thing, too), but 
you can get at them from



If it were me (speaking only as to what I think is reasonable and fair), I 
wouldn't send an SMS except on the express permission of the user, every time, 
and at least offering to show the full text of the message, every time.

— 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: Visible Rect and objectValueForColumn

2010-09-25 Thread Fritz Anderson
On 24 Sep 2010, at 10:10 AM, k...@highrolls.net wrote:

> Is it true that NSTableDataSource method 
> tableView:objectValueForTableColumn:row is called as function of ther 
> associated NSTableView's visible rect?
> 
> If so, can one make adjustments to the visible rect thereby tricking 
> NSTableDataSource into calling tableView:objectValueForTableColumn:row ?

Why would you want to? NSTableView is a view — it cares only about the rows and 
columns it has to draw. It doesn't need to know the values behind parts of the 
table that aren't visible. It doesn't keep those values, it only pulls them out 
of your code and draws them. In practice, so far as the table view is 
concerned, those parts don't even exist. If you want to evaluate other parts of 
your model, have your model do it itself.

— 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: "Settings" button in UITableView

2010-09-25 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/24/10 9:31 AM, Remco Poelstra wrote:
> Interesting point, I've been thinking about that as well. The problem
> is that I think it's confusing for the user. In the wifi settings
> pane, the user either selects the row or goes to a detail view. In my
> case the user goes to a tableview when he selects the row, but the
> disclosure button will give a (modal) detail view, so the responses
> are quite the same. Wouldn't that confuse them?

Hmm, you're right about the Settings app.  I guess I should verify such
things before blurting them out.  I could have sworn I saw such an
implementation, but now I can't remember where.

While searching around for the above behavior, I did come across another
paradigm that you can consider.  ADA-winning OmniFocus lets you edit
projects and contexts by entering edit mode via a UIBarButtonItem (as
you intended), followed by simply tapping the row.  They use the
standard delete controls as well (which it sounds like may not be
applicable in your situation).  Not sure how intuitive this approach is,
but it is one way people solve your problem.

My recommendation, since all of the approaches are easy to implement, is
just to create mock-ups with all three and hand them to different target
users and see which lets them figure out usage easiest.  (Nothing beats
an experiment.)

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyeQJQACgkQaOlrz5+0JdVNCQCfTcLscYxethve/7p7kRTQ7CPW
pO0AnjW7QT2jWGaLqZpD4ynUiKO5g6Ce
=wc+e
-END PGP 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


In-app SMS

2010-09-25 Thread Dan Hopwood
Hi all,

I found the following link with info on how to send SMSs from within an
application.

http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/

I have not tested this yet but have the following question. If the above
does work, do Apple allow applications onto the App Store that use such a
technique or does it depend on the context. For example, it would make sense
that Apple reject an application that spams the users contacts on every
launch but perhaps not for an app that replies on sending SMSs for it's
purpose.

Thanks in advance for any advice.

Dan
___

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: Converting an AttributedString into NSData for an NSTextView

2010-09-25 Thread Keary Suska
On Sep 25, 2010, at 10:06 AM, Brad Stone wrote:

> I've been programming in Cocoa for 12 months now so I may not understand the 
> subject fully but my NSTextView Data binding is connected to a Core Data 
> attribute of type "Binary Data" (NSData) and this works when I manually type 
> in text, set some attributes like underline or font, save it and reopen it.  

Yes--don't make assumptions about how the API works. You'll just end up saying 
something nonsensical, and respondents can't do much more than point that fact 
out.

Also, if you want useful answers to questions, you need to explain specifically 
what you need to accomplish, and the conditions under which you need to 
accomplish it. E.g., bindings will usually change an entire scenario.

> Since I have 4,000 files to cycle through I want to do this all 
> programatically.  To simplify things I tried to do this with an NSString 
> instead of an NSAttributableString.  I wrote a test app that creates a new 
> document, pulls the entity "newNote" and uses the following code to set the 
> NSData object:
> 
> NSData *noteData = [s dataUsingEncoding:NSUnicodeStringEncoding]; 
> [newNote setValue:noteData forKey:@"noteData"];
>   
> I then save the document and loop around again.  This works fine with the 
> NSString.  After the 4,000 are loaded in, if I open one of the documents in 
> my interface and look in the textView I see the string.  I guess don't fully 
> understand how to repeat this process with an AttributedString.  I don't see 
> how NSTextStorage applies in this scenario.  Maybe I'm skipping a step.

What, specifically, don't you get? What method calls have you tried? Have you 
read the "Attributed String Programming Guide"?

> On Sep 25, 2010, at 11:28 AM, Keary Suska wrote:
> 
>> 
>> On Sep 25, 2010, at 9:12 AM, Brad Stone wrote:
>> 
>>> I have an NSMutableString that I want to set as the NSData source for an 
>>> NSTextView.  I'm stuck and don't know how to do it.   I'm importing about 
>>> 4,000 XML files and I have to programmatically create the attributedString 
>>> for each one, there's no way around it.
>>> 
>>> How do I convert an NSMutableString to NSData so it can be the data source 
>>> for an NSTextView?
>> 
>> NSTextView doesn't use NSData as its "data source"--it uses NSTextStorage. 
>> You can get its content as a mutable string using -mutableString and 
>> manipulate it.


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: "Settings" button in UITableView

2010-09-25 Thread Matt Neuburg
On or about 9/24/10 9:36 AM, thus spake "Remco Poelstra"
:

> Is there some precaution I've to take to make sure the buttons slide in nicely
> like they do in the mail app? I've currently no idea about coding animations
> and such.

Animation is easy. Just remember that only the visible cells (-visibleCells)
need animating. m.

-- 
matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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: Converting an AttributedString into NSData for an NSTextView

2010-09-25 Thread Brad Stone
I've been programming in Cocoa for 12 months now so I may not understand the 
subject fully but my NSTextView Data binding is connected to a Core Data 
attribute of type "Binary Data" (NSData) and this works when I manually type in 
text, set some attributes like underline or font, save it and reopen it.  

Since I have 4,000 files to cycle through I want to do this all 
programatically.  To simplify things I tried to do this with an NSString 
instead of an NSAttributableString.  I wrote a test app that creates a new 
document, pulls the entity "newNote" and uses the following code to set the 
NSData object:

NSData *noteData = [s dataUsingEncoding:NSUnicodeStringEncoding]; 
[newNote setValue:noteData forKey:@"noteData"];

I then save the document and loop around again.  This works fine with the 
NSString.  After the 4,000 are loaded in, if I open one of the documents in my 
interface and look in the textView I see the string.  I guess don't fully 
understand how to repeat this process with an AttributedString.  I don't see 
how NSTextStorage applies in this scenario.  Maybe I'm skipping a step.



On Sep 25, 2010, at 11:28 AM, Keary Suska wrote:

> 
> On Sep 25, 2010, at 9:12 AM, Brad Stone wrote:
> 
>> I have an NSMutableString that I want to set as the NSData source for an 
>> NSTextView.  I'm stuck and don't know how to do it.   I'm importing about 
>> 4,000 XML files and I have to programmatically create the attributedString 
>> for each one, there's no way around it.
>> 
>> How do I convert an NSMutableString to NSData so it can be the data source 
>> for an NSTextView?
> 
> NSTextView doesn't use NSData as its "data source"--it uses NSTextStorage. 
> You can get its content as a mutable string using -mutableString and 
> manipulate it.
> 
> 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: Converting an AttributedString into NSData for an NSTextView

2010-09-25 Thread Keary Suska

On Sep 25, 2010, at 9:12 AM, Brad Stone wrote:

> I have an NSMutableString that I want to set as the NSData source for an 
> NSTextView.  I'm stuck and don't know how to do it.   I'm importing about 
> 4,000 XML files and I have to programmatically create the attributedString 
> for each one, there's no way around it.
> 
> How do I convert an NSMutableString to NSData so it can be the data source 
> for an NSTextView?

NSTextView doesn't use NSData as its "data source"--it uses NSTextStorage. You 
can get its content as a mutable string using -mutableString and manipulate it.

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


Converting an AttributedString into NSData for an NSTextView

2010-09-25 Thread Brad Stone
I have an NSMutableString that I want to set as the NSData source for an 
NSTextView.  I'm stuck and don't know how to do it.   I'm importing about 4,000 
XML files and I have to programmatically create the attributedString for each 
one, there's no way around it.

How do I convert an NSMutableString to NSData so it can be the data source for 
an NSTextView?

Thanks___

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: What would cause my animation's delegate methods to not be called?

2010-09-25 Thread Gideon King
As another data point, I have run exactly the same code on 10.5, and the 
animation delegate methods are called there.

Gideon

On 25/09/2010, at 12:46 PM, Gideon King wrote:

> Hi, I have a CALayer subclass with a CGPoint that I am animating using a 
> CABasicAnimation. The layer is one of many sublayers in a layer hosting view. 
>  
> 
> I set up the animation to point to my layer as the delegate, and use 
> addAnimation:forKey: to add the animation. The animation works fine, but the 
> animationDidStart: and animationDidStop:finished: methods are never called.
> 
> I am not setting up an animation group, and it doesn't seem to make any 
> difference whether I use an explicit transaction or not.
> 
> Any ideas why the animation delegate methods would not be called?
> 
> 
> Thanks
> 
> Gideon
> 
> 
> 
> 

___

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