Re: Wanted: new owner for Mac apps

2013-05-09 Thread Charles Srstka
On May 8, 2013, at 7:25 PM, Alex Zavatone z...@mac.com wrote:

 On May 8, 2013, at 8:17 PM, Luther Baker wrote:
 
 Steve's entire thread was about giving away his source code -- he even keeps 
 us up to date as it starts to leave his hands ... and you read snippy into 
 that last comment? ... and then decide to publicly call him out on it?
 
 Yes.
 
 Because I read it as it appeared he was giving away his code, then the 
 repository was pulled down, someone complained and he said something to the 
 effect of now you have learned that nothing's permanent.
 
 Considering that he announced giving away the code just a few days ago and 
 pulled the repo already, that part came across as snippy.

Is this really necessary?

Charles

___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Wanted: new owner for Mac apps

2013-05-09 Thread Steven Degutis
Alex, I think my favorite part of your response is that, what I said
wasn't something to be vaguely recalled, a lost moment enveloped in a
foggy memory, a fragment of a conversation hopelessly swallowed by the
past. There was no reason to settle for remembering something to the
effect of it.

On Thu, May 9, 2013 at 3:10 AM, Charles Srstka cocoa...@charlessoft.com wrote:
 On May 8, 2013, at 7:25 PM, Alex Zavatone z...@mac.com wrote:

 On May 8, 2013, at 8:17 PM, Luther Baker wrote:

 Steve's entire thread was about giving away his source code -- he even 
 keeps us up to date as it starts to leave his hands ... and you read 
 snippy into that last comment? ... and then decide to publicly call him 
 out on it?

 Yes.

 Because I read it as it appeared he was giving away his code, then the 
 repository was pulled down, someone complained and he said something to the 
 effect of now you have learned that nothing's permanent.

 Considering that he announced giving away the code just a few days ago and 
 pulled the repo already, that part came across as snippy.

 Is this really necessary?

 Charles

 ___

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/sbdegutis%40gmail.com

 This email sent to sbdegu...@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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


UILabel with superscripts

2013-05-09 Thread Koen van der Drift
Right now I am using an UILabel with unicode symbols to show strings with 
superscripts, something like this:

NSInteger base = 2;
myLabel.text = [NSString stringWithFormat: @%d\u00B2 = %d, base, 
base*base];

But it kinda looks ugly in my opinion, the subscript is too low relative to the 
regular characters.  Maybe it's the font I'm using, which is the standard 
system font.  Are there alternatives? I read about using an UIWebView, but that 
seems a bit overkill for a simple string.

Thanks,

- Koen.



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: UILabel with superscripts

2013-05-09 Thread Diederik Meijer | Ten Horses
Have you tried loading a NSAttributedString? It's iOS 6 only, a quick search 
implies you can set 
kCTSuperscriptAttributeName to specific ranges in your string...


Verstuurd vanaf mijn iPhone

Op 9 mei 2013 om 14:04 heeft Koen van der Drift koenvanderdr...@gmail.com het 
volgende geschreven:

 Right now I am using an UILabel with unicode symbols to show strings with 
 superscripts, something like this:
 
NSInteger base = 2;
myLabel.text = [NSString stringWithFormat: @%d\u00B2 = %d, base, 
 base*base];
 
 But it kinda looks ugly in my opinion, the subscript is too low relative to 
 the regular characters.  Maybe it's the font I'm using, which is the standard 
 system font.  Are there alternatives? I read about using an UIWebView, but 
 that seems a bit overkill for a simple string.
 
 Thanks,
 
 - Koen.
 
 
 
 ___
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.com
 
 This email sent to diede...@tenhorses.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-09 Thread Jens Alfke

On May 8, 2013, at 6:25 PM, Andy Lee ag...@mac.com wrote:

 Yup. I had edge-case crashes too (fortunately reproducible one I knew the 
 right edge case), and spent hours tracking it down to reentrancy problems in 
 initWithHTML. Fortunately I could count on getting well-formed XML, and like 
 Jens all I needed was to extract plain text, so I changed my solution to use 
 NSXMLDocument and the crash went away.

You actually don’t need well-formed X[H]TML to use NSXMLDocument. One of the 
option flags to the -init method tells it to run the ‘htmltidy’ preprocessor 
over the input, which will correct even the gnarliest hand-written tag-soup 
HTML into something the XML parser can handle. It’s extremely useful for 
handling random web content.

—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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-09 Thread Markus Spoettl

On 5/9/13 6:26 PM, Jens Alfke wrote:

Yup. I had edge-case crashes too (fortunately reproducible one I knew the
right edge case), and spent hours tracking it down to reentrancy problems
in initWithHTML. Fortunately I could count on getting well-formed XML, and
like Jens all I needed was to extract plain text, so I changed my solution
to use NSXMLDocument and the crash went away.


You actually don’t need well-formed X[H]TML to use NSXMLDocument. One of the
option flags to the -init method tells it to run the ‘htmltidy’ preprocessor
over the input, which will correct even the gnarliest hand-written tag-soup
HTML into something the XML parser can handle. It’s extremely useful for
handling random web content.


Well, that's not entirely true, unfortunately. Although the documentation 
suggests you can, NSXMLDocument -init will crash if the content you're 
trying to feed it is sufficiently non-XML (say an ASCII text file).


We get this all the time and it's a major pain.

Regards
Markus
--
__
Markus Spoettl
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-09 Thread Andy Lee

On May 9, 2013, at 1:53 PM, Markus Spoettl ms_li...@shiftoption.com wrote:

 On 5/9/13 6:26 PM, Jens Alfke wrote:
 Yup. I had edge-case crashes too (fortunately reproducible one I knew the
 right edge case), and spent hours tracking it down to reentrancy problems
 in initWithHTML. Fortunately I could count on getting well-formed XML, and
 like Jens all I needed was to extract plain text, so I changed my solution
 to use NSXMLDocument and the crash went away.
 
 You actually don’t need well-formed X[H]TML to use NSXMLDocument. One of the
 option flags to the -init method tells it to run the ‘htmltidy’ preprocessor
 over the input, which will correct even the gnarliest hand-written tag-soup
 HTML into something the XML parser can handle. It’s extremely useful for
 handling random web content.

Good to know.

 Well, that's not entirely true, unfortunately. Although the documentation 
 suggests you can, NSXMLDocument -init will crash if the content you're 
 trying to feed it is sufficiently non-XML (say an ASCII text file).
 
 We get this all the time and it's a major pain.

And good to know.

Thanks!

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Can scroll direction be changed programmatically?

2013-05-09 Thread Steven Degutis
I found a solution using AppleScript[1] but it seems like it may be fragile
(uses magic numbers, etc).

Is there another way?

-Steven

[1]
http://apple.stackexchange.com/questions/60877/toggle-natural-scrolling-from-command-line-with-reload
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-09 Thread Jens Alfke

On May 9, 2013, at 10:53 AM, Markus Spoettl ms_li...@shiftoption.com wrote:

 Well, that's not entirely true, unfortunately. Although the documentation 
 suggests you can, NSXMLDocument -init will crash if the content you're 
 trying to feed it is sufficiently non-XML (say an ASCII text file).

Well, that’s bad, especially since one of the purposes of tidy is to make it 
safe to read untrusted XML/HTML input. 
Have you reported this to Radar?

—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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Kyle Sluder
On Thu, May 9, 2013, at 11:55 AM, Steven Degutis wrote:
 I found a solution using AppleScript[1] but it seems like it may be
 fragile
 (uses magic numbers, etc).
 
 Is there another way?

What are you actually trying to accomplish?

NSEvent has -isDirectionInvertedFromDevice, which can be used to
override the user's setting when it makes sense. Does that satisfy your
needs?

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Steven Degutis
 What are you actually trying to accomplish?

I often switch between using my rMBP directly, and plugging it into
this giant monitor. When I'm just using the rMBP's trackpad, I want
the scroll direction to be natural. But when I'm plugged in and using
a mouse, I'd prefer it to be unnatural.

So I'm hoping to find some way of programmatically doing this. Then I
can plug my solution into my Zephyros config and bind it to a global
hotkey. This app is super handy.

It would be even better actually if I could find some notification
that's triggered when you plug into or unplug from an external
monitor, then it would automatically toggle this for me.

I found out that it's the global defaults key
com.apple.swipescrolldirection, but I can't figure out how to force
every open app to notice the new value when I set it. Seems like I'd
probably have to kill loginwindow or something to get the OS to
register that I changed this. And that seems like a dumb idea.

-Steven
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Does initWithHTML:dataUsingEncoding:documentAttributes: run an event loop?

2013-05-09 Thread Alex Kac
I'd strongly recommend a great tool from the DTCoreText github project - 
DTHTMLWriter and DTHTMLReader. It is designed to work with HTML documents and 
turn them into XML or like (he uses it for NSAttributedStrings).

I've been using this project very heavily and it works extremely well. For 
example I use it to convert HTML to ENML for Evernote. It works with loads of 
poorly formatted HTML.

On May 9, 2013, at 12:58 PM, Jens Alfke j...@mooseyard.com wrote:

 
 On May 9, 2013, at 10:53 AM, Markus Spoettl ms_li...@shiftoption.com wrote:
 
 Well, that's not entirely true, unfortunately. Although the documentation 
 suggests you can, NSXMLDocument -init will crash if the content you're 
 trying to feed it is sufficiently non-XML (say an ASCII text file).
 
 Well, that’s bad, especially since one of the purposes of tidy is to make it 
 safe to read untrusted XML/HTML input. 
 Have you reported this to Radar?
 
 —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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Kyle Sluder
On Thu, May 9, 2013, at 12:13 PM, Steven Degutis wrote:
  What are you actually trying to accomplish?
 
 I often switch between using my rMBP directly, and plugging it into
 this giant monitor. When I'm just using the rMBP's trackpad, I want
 the scroll direction to be natural. But when I'm plugged in and using
 a mouse, I'd prefer it to be unnatural.

Ah, yeah, I doubt there's any way other than what you've found.

But I'd also consider just adopting the natural approach. It took me
about a week to adjust.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Scott Ribe
On May 9, 2013, at 1:19 PM, Kyle Sluder wrote:

 But I'd also consider just adopting the natural approach. It took me
 about a week to adjust.

FYI, I've never been able to adjust to it when using a mouse at my 
desk--perfectly fine with it when using the trackpad, but not the mouse...

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Steve Mills
On May 9, 2013, at 14:30:24, Scott Ribe scott_r...@elevated-dev.com wrote:

 FYI, I've never been able to adjust to it when using a mouse at my 
 desk--perfectly fine with it when using the trackpad, but not the mouse...

Apple really needs the scrolling direction to be set on a per-input-device 
basis. Personally, I hate the natural setting, which is only natural on a 
touchscreen device like an iPad.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Setting Up a MVC most of it works BUT

2013-05-09 Thread YT
So I've spent the past few hours reading and am now trying to set up a simple 
MVC. 

I constructed a few buttons and textfields in a Window in IB
The View will instantiate when the Xib is loaded (so I've read anyway)

I created a MyController based on NSObject in the Xib SO once the Xib is loaded 
MyController is instantiated. 
NSLOGs indicate this is so.

I connected the UI elements to MyController.

NOW as MyController inits I have it THEN instantiate myDataModel object. 
NSLOGs indicate myDataModel comes up.

The UI elements in Window capture data correctly.
The save button retrieves the data from the Window and MyController sends the 
data to myDataModel.
NSLOGs indicate that is working as expected.  

All that appears to be working. 

BUT how does one send data from myDataModel to MyController.
OR is that by request from MyController only?

I tried to send MyController's ID during MyDataModel initialization.
That works NSLOGs indicate MyDataModel receives MyController's ID.

When I have MyController call a method in MyDataModel and attempt to call a 
method in MyController
I get an error during compile ! No Visible @interface for NSObject 

I have MyDataModel do the [super init] initialization.  
At the moment I'm baffled - 
Any advise would be appreciated. 

Probably have taken the wrong tack - I tend to do that.

YT



___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Uli Kusterer
On 09.05.2013, at 20:55, Steven Degutis sbdegu...@gmail.com wrote:
 I found a solution using AppleScript[1] but it seems like it may be fragile
 (uses magic numbers, etc).
 
 Is there another way?


I wonder if an event tap and just changing the direction on each scroll event 
would work? Could also listen to CGDisplayConfigurationChanged callback in the 
app that filters the events to see when an external screen is plugged in.

Cheers,
-- Uli Kusterer
The Witnesses of TeachText are everywhere...
http://www.masters-of-the-void.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Steven Degutis
Kinda like https://github.com/invariant/Scroll-Reverser ? Someone
showed me this and I glanced at the source code, and was not fond of
this technique.

On Thu, May 9, 2013 at 7:26 PM, Uli Kusterer
witness.of.teacht...@gmx.net wrote:
 On 09.05.2013, at 20:55, Steven Degutis sbdegu...@gmail.com wrote:
 I found a solution using AppleScript[1] but it seems like it may be fragile
 (uses magic numbers, etc).

 Is there another way?


 I wonder if an event tap and just changing the direction on each scroll event 
 would work? Could also listen to CGDisplayConfigurationChanged callback in 
 the app that filters the events to see when an external screen is plugged in.

 Cheers,
 -- Uli Kusterer
 The Witnesses of TeachText are everywhere...
 http://www.masters-of-the-void.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Setting Up a MVC most of it works BUT

2013-05-09 Thread Graham Cox

On 10/05/2013, at 10:35 AM, YT y...@redwoodcontent.com wrote:

 BUT how does one send data from myDataModel to MyController.
 OR is that by request from MyController only?

It can be, but not exclusively. Sometimes your data model might want to push 
a value to the interface for display. It all depends on what it does.

 I tried to send MyController's ID during MyDataModel initialization.
 That works NSLOGs indicate MyDataModel receives MyController's ID.
 
 When I have MyController call a method in MyDataModel and attempt to call a 
 method in MyController
 I get an error during compile ! No Visible @interface for NSObject 
 
 I have MyDataModel do the [super init] initialization.  
 At the moment I'm baffled - 
 Any advise would be appreciated. 


-init is too soon. The interface is loaded after initialization, which is why 
it isn't available then. Instead, override the -awakeFromNib method and do the 
necessary stuff there. That is called after the interface is loaded, and is 
provided for this purpose. It is guaranteed to be called only once all of the 
interface is available.

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Can scroll direction be changed programmatically?

2013-05-09 Thread Graham Cox

On 10/05/2013, at 5:44 AM, Steve Mills smi...@makemusic.com wrote:

 Apple really needs the scrolling direction to be set on a per-input-device 
 basis. Personally, I hate the natural setting, which is only natural on a 
 touchscreen device like an iPad.


Seconded. Lets all file radars...

--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Setting Up a MVC most of it works BUT

2013-05-09 Thread Graham Cox

On 10/05/2013, at 10:35 AM, YT y...@redwoodcontent.com wrote:

 BUT how does one send data from myDataModel to MyController.
 OR is that by request from MyController only?


Just to elaborate on my previous answer, there are several techniques that are 
commonly used to update an interface when something in the data model changes. 
These are, in order of complexity/understandability/history:

a) the data model explicitly calls a method of the controller to tell it about 
a change. This isn't great, because it sets up a strong dependency between the 
data model classes and the controller class(es).

a+) the data model declares an informal or formal protocol that some designated 
object (called a delegate, and this could be your controller) can implement. 
The data model calls these delegate methods for certain specific activities. 
This is really just a more elaborate form of a), which is why I call it a+, 
though with care it can be more generic and anonymous, and therefore can have 
better decoupling than a.

b) the data model uses the notification center to notify changes, and the 
controller listens for these notifications.

c) the controller uses key-value observing (KVO) to monitor property changes of 
the model directly.

d) Bindings, which are built on KVO.


Searching the documentation with these terms should yield the relevant 
information.


--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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


setFrame: weirdness in UITableViewCell

2013-05-09 Thread Laurent Daudelin
I'm trying to use a custom view which does only one thing: drawing the rect 
defined by its bounds:

- (void)drawRect:(CGRect)rect
{
// Drawing code
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds
   
byRoundingCorners:UIRectCornerAllCorners
 
cornerRadii:CGSizeMake(4.0f, 4.0f)];
[path setLineWidth:2.0f];
[[UIColor darkGrayColor] set];
[path stroke];
}

I have one instance added to a UITableViewCell in a storyboard and it works 
about right half the time. The other half of the time, the rectangle drawn is 
too high or too low:



The strange thing is that when I set the frame in my code using this custom 
view, I print the frame right after I set it and I get this in the console:

2013-05-08 15:26:19.602 erodr[35723:c07] Post “Test post”: 
locationBoxedView.frame origin: {233, 29}, size: {75, 19}

I partially override the setFrame: method in my custom view just to print the 
new frame. This is what I do:

- (void)setFrame:(CGRect)frame
{
[super setFrame:frame];
NSLog(@Frame set to %@, NSStringFromCGRect(frame));
}

And this is what I get in the console:

2013-05-08 15:26:19.603 erodr[35723:c07] Frame set to {{108, 40}, {46, 22}}
2013-05-08 15:26:19.603 erodr[35723:c07] Frame set to {{233, 18}, {75, 19}}

I believe the first Frame set is called when a new instance of the tableview 
cell is created from the storyboard. But how is the second setFrame: call ends 
with setting the frame to 233, 18 when the calling code sets it to 233,29?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Writing a custom Spotlight Importer

2013-05-09 Thread Vincent CARLIER
Hello everybody,

I've written a Spotlight Importer for my custom document format. The
document has an UTI, used by the Spotlight Importer.

Everything is fine, I can see my Metadata Fields correctly indexed by
Spotlight, I can see the right importer loaded (it is bundled into the
.app) when I run `mdimport -L`, except the Finder doesn't display the
fields I've said it to display.

Here is what the schema.xml file look like :

   ?xml version=1.0 encoding=UTF-8?

   schema version=1.0
   xmlns=http://www.apple.com/metadata;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=
http://www.apple.com/metadatafile:///System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Resources/MetadataSchema.xsd

   attributes
   attribute name=com_myDomain_myApp_myDocument_test
multivalued=false type=CFString /
   /attributes
   types
   type name=com.myDomain.myapp.mydocument
   allattrs
   kMDItemTitle
   kMDItemAuthors
   kMDItemAlbum
   com_myDomain_myApp_myDocument_test
   /allattrs
   displayattrs
   kMDItemTitle
   kMDItemAuthors
   kMDItemAlbum
   com_myDomain_myApp_myDocument_test
   /displayattrs
   /type
   /types
/schema

I wasn't able to validate this file syntax (but it seems right), my system
is lacking the `mdcheckschema` command, and I can't find it anywhere. Also
I thought that fields appearing in the `displayattrs` would have been
displayed by the Finder's Get Info pane.

The `schema.xml` file appears at the right place into the mdimporter
bundle. This is really annoying, since I use already defined fields, and
only one custom field. Apple's documentation doesn't tell anything on this
situation and I wasn't able to find an answer to my problem.

Does anybody know what to do to have those informations displayed by the
Finder's More Info section ?
Maybe someone can provide useful tips ?

Vince.
___

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: What am I looking for in the documentation?

2013-05-09 Thread Mohit Sharma
You might want to look at sprintf http://linux.die.net/man/3/sprintf.
sprintf(text, %f, fv) should work just fine.


On Sat, May 4, 2013 at 4:20 PM, YT y...@redwoodcontent.com wrote:

 I have need to turn a local float value into a char array.

 That is, The Quartz 2D graphics function requires the passing of a (const
 char *) to a text string or I was thinking of a character array.

 My mind is mush at the moment - can't seem to recall the way to program a
 conversion of

 float fv = 40.0;

 into

 const char *text = 40.0;

 or

 const char text[ ] = 40.0;


 Please advise...

 Thanks YT



 ___

 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:

 https://lists.apple.com/mailman/options/cocoa-dev/mohit.sharma0690%40gmail.com

 This email sent to mohit.sharma0...@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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


UIWebView IBOutlet is always nil

2013-05-09 Thread Michael Crawford
I have a UINavigationController-based app that I would like to use a
UIWebView to show an HTML page.  My problem is that I declare my UIWebView
property as an IBOutlet, and it is always nil.

This is apparently a very common problem.  Google turns up lots of queries
at StackOverflow.  I read them all, but no joy.

I tried deleting my build folder, and my built app, but that didn't help.

My XIB file has a UIView with the UIWebView on top of it.  Is that
correct?  Or am I supposed to use a UIWindow?

The file's owner has the IBOutlet that references the UIWebView.  I've
tried connecting the file's owner view IBOutlet both to the file-scoped
view, and to the UIWebView.

The file's owner is declared as a ManualViewControllerIOS in the Identity
inspected.

   // ManualViewControllerIOS.h
   #import UIKit/UIKit.h

   @interface ManualViewControllerIOS : UIViewController {

   }

   @property (retain,nonatomic) IBOutlet UIWebView *webView;

   @end

// ManualViewControllerIOS.m
   #import ManualViewControllerIOS.h

   @implementation ManualViewControllerIOS

   @synthesize webView;

   - (void) viewDidAppear: (BOOL) animated
   {
   [super viewDidAppear: animated];

   NSString *manualIndex;

   NSBundle *mainBundle = [NSBundle mainBundle];

   manualIndex = [mainBundle pathForResource:
   @index ofType: @html];

   NSLog( @%@, webView );

   [webView loadRequest:
[NSURLRequest requestWithURL:
 [NSURL URLWithString: manualIndex]]];
   }
   @end

Here is how I push my view controller onto the UINavigationController stack:

   - (IBAction) manual: (id) sender
   {
   ManualViewControllerIOS *manualViewController =
[[[ManualViewControllerIOS alloc] init] autorelease];

   [self.navigationController pushViewController: manualViewController
animated: YES];

   return;
   }

My App is quite complex, so I'm writing an online manual.  At first I was
loading it from my website, but that doesn't satisfy when the Internet is
out of reach.  UIWebView would be the cat's meow if I could get it to work.

Thanks for any help you can give me,

Mike
-- 
Michael David Crawford
mdcrawford at gmail dot 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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