Re: Versioning / increasing build number

2010-02-09 Thread Austin Ziegler
[I sent this reply privately to Stefan a few days ago and realized
that it hadn't come to the mailing list.]

On Fri, Feb 5, 2010 at 12:26 PM, Stefan Wolfrum  wrote:
> Okay, found & read Chris Hanson's blog article from 2005:
> http://chanson.livejournal.com/125568.html
>
> I totally agree with the guy who wrote the first comment!
>
> So, looks like agvtool is the wrong path to follow if I want an integer build 
> number that just increases everytime
> I hit cmd-R or cmd-Y or cmd-B or variations of those.

This does more than you need if your'e not using Git, but it's a good
basis for making your own incremental versioning system. If you're
using SVN, it's fairly easy to look for "svn tag version xcode".

http://github.com/halostatue/xcode-git-version

-austin
-- 
Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca
http://www.halostatue.ca/ • http://twitter.com/halostatue
___

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: SQLite mime type?

2009-12-31 Thread Austin Ziegler
On Tue, Dec 29, 2009 at 4:13 PM, Paul Archibald  wrote:
> Cool, thanks, I'll try that.

> On Dec 29, 2009, at 11:10 AM, davel...@mac.com wrote:
>> On Dec 29, 2009, at 11:56 AM, Paul Archibald wrote:
>>> I am using SQLite in my iPhone app. and i want to be able to email the
>>> database file. I see that attaching it to a message is pretty
>>> straightforward, but the addAttachmentData method requires a mime type, and
>>> I  don't know what that should be. Any ideas out there?
>>
>>
>> I don't know if this is the "correct" one, but application/octet-stream
>> seems to work fine for me in my Attendance app.

The best choice is to use an application-specific extension MIME type:

  application/x-sqlite3

Or,  if you don't want this DB to be generally usable/recognisable,
make it specific to your app:

  application/x-myiphone-app

IIRC, most browsers that don't know how deal with an x- treat it as
octet-stream, but it gives other programs with more information on
application/x-sqlite3 or application/x-myiphone-app a way to deal with
it better.

-austin
-- 
Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca
http://www.halostatue.ca/ • http://twitter.com/halostatue
___

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: retain and don`t retain in accessor methods

2009-11-16 Thread Austin Ziegler
On Sun, Nov 15, 2009 at 10:35 AM, Clark Cox  wrote:
> On Sat, Nov 14, 2009 at 11:35 PM, Ariel Feinerman  
> wrote:
>> 2009/11/15 Kyle Sluder 
>>> On Sat, Nov 14, 2009 at 2:35 PM, Ariel Feinerman 
>>> wrote:
>>> > I need two versions of -initWith ... and -set ... methods of custom timer
>>> > class (for example, to prevent the circle references);
>>> Do not use accessors in your initializers or -dealloc.
>> Hm, it means to do the same work two times, I think. For example if I change
>> the mechanism in the setting of instance variables, I must to change one in
>> difference inits method; can you say a reason?
> The reason often given (to which I don't personally subscribe) is that
> the accessor could be overridden in a subclass, and therefore do
> things that aren't appropriate (i.e. they could assume something about
> the already-dealloc'ed or not-yet-init'ed portions of the subclass).

Is that true anymore, though? I've been looking at a lot of sample
code lately, and it's very common practice to use "self.foo = ..." in
initializers, even when they're declared nonatomic. I know you said
you don't subscribe to it, but it seems to be an accepted practice
these days.

As to the original question, I'm not a Cocoa expert (far from it!),
but on general principles that sort of flag raises a code smell.
Sometimes it's unavoidable, but I'd either:

* use two different classes that have different ownership expectations
(one expects ownership and retains; the other does not and does not);
or
* have two different initializers with different names indicating the
different ownership (e.g., initWithTarget, initWithObserved). You may
have some code duplication here, but you could minimize some of that
with a "- (void)initTimer" method that sets time and calls begin.

-austin
-- 
Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca
http://www.halostatue.ca/ • http://twitter.com/halostatue
___

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: Wrapping C functions in Objective C proxy objects: naming convention?

2008-11-20 Thread Austin Ziegler
On Thu, Nov 20, 2008 at 6:09 PM, Ken Tozier <[EMAIL PROTECTED]>
wrote:
> Just out of curiosity, why do you need to send such common math
> operations to a soap request? Wouldn't it be easier to do simple stuff
> like calculations in your Soap class and only make requests for the
> unique services the endpoint provides?

What I presented here was sample code that's fed to the gSOAP generator
(soapcpp2). What I'm writing is a further generator that will generate
an Objective C proxy on top of the gSOAP service.

I personally don't ever need to do add, sub, mul, div, or pow. However,
looking at how SOAP clients and servers are implemented using these
simple examples is instructive.

Trust me; the stuff I am *really* doing is a few orders harder than
simple math operations. But as you're doing something new, it's always
smart to take baby steps.

-austin
-- 
Austin Ziegler * [EMAIL PROTECTED] * http://www.halostatue.ca/
   * [EMAIL PROTECTED] * http://www.halostatue.ca/feed/
   * [EMAIL PROTECTED]
___

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 [EMAIL PROTECTED]


Re: Wrapping C functions in Objective C proxy objects: naming convention?

2008-11-20 Thread Austin Ziegler
On Thu, Nov 20, 2008 at 12:15 PM, Michael Ash <[EMAIL PROTECTED]> wrote:
> Please excuse a foolish question, but Why wrap this in Objective-C
> at all? Looks like the resulting ObjC code is essentially the same,
> except uglier, slower, and harder to use. Why not just keep the C and
> use it directly?

This isn't a foolish question. The function declaration that I've shown
you is something of a fiction; it's a definition in an input file to a
code generator (gSOAP). It doesn't actually exist in the resulting C
code. This definition:

>>  int ns__add(double a, double b, double *result);

will actually become:

  int soap_call_ns__add(struct soap *soap, const char *endpoint,
const char *action, double a, double b,
double result*);

gSOAP knows how to generate C and C++ and with C++ will generate a proxy
for this C function and the SOAP object, so that it looks more like:

  class calcProxy
  {
  public:
int add(double a, double b, double *result)
{
  return soap_call_ns__add(soap, endpoint, "", a, b, result);
}

struct soap *soap;
char *endpoint;
  }

What I want to do is to create an ObjC proxy similar to the C++ proxy.

Yes, I know I could use ObjC++, but there are reasons I want to use ObjC
instead of ObjC++ including not having to deal with two different object
models in my ObjC programs.

Generating the proxy isn't going to be that hard; I'm just trying to
figure out what the best naming conventions for these generated methods
and classes will be.

-austin
-- 
Austin Ziegler * [EMAIL PROTECTED] * http://www.halostatue.ca/
   * [EMAIL PROTECTED] * http://www.halostatue.ca/feed/
   * [EMAIL PROTECTED]
___

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 [EMAIL PROTECTED]


Re: Wrapping C functions in Objective C proxy objects: naming convention?

2008-11-20 Thread Austin Ziegler
On Thu, Nov 20, 2008 at 4:54 AM, Alexander Spohr <[EMAIL PROTECTED]> wrote:
> I'd go for #1.
> If you have an error in status, throw an exception.
>
> What is the reason to put those functions in a class anyway if you just
> mimic the c-function? Are you adding anything?

Yes, I am. The C function definition that I showed was actually just a
SOAP service definition. What my proxy object will be calling are
about three or four different C functions to make the SOAP call,
hiding that complexity from the programmer. (I could just use C++ and
have this code generated for me automatically, but this is also an
intellectual challenge to generate these Objective C wrappers that
mimic what the C++ code does.)

-austin

> Am 20.11.2008 um 06:27 schrieb Austin Ziegler:
>> For a project that I'm working on, I have a need to write a code
>> generator that will wrap certain kinds of C functions as Objective C
>> messages on an Objective C proxy. Because I don't ultimately control
>> the input, the parameters on the C functions may be poorly named. I'm
>> looking for advice on how one might make useful object message names
>> from C functions.
>>
>> The format of the functions in question is essentially like this[1]:
>>
>>  int ns__add(double a, double b, double *result);
>>  int ns__sub(double a, double b, double *result);
>>  int ns__mul(double a, double b, double *result);
>>  int ns__div(double a, double b, double *result);
>>  int ns__pow(double a, double b, double *result);
>>
>> The int return is a status code; the result of the operation is in
>> double* result. If there's an error in the operation. (The status code
>> may be ignorable, in which case part of my following question is
>> answered; I'm still researching this part. I suspect that it is best
>> not ignored.)
>>
>> Anyway, the problem is how I should convert this function with poorly
>> named parameters into a proxy object and messages?
>>
>> The options that I've come up with (expressed in terms of use) follow.
>> They're all expressed in terms of an object ns__CalcProxy:
>>
>>  ns__CalcProxy calc = [[ns__CalcProxy alloc] init];
>>  double a, b, result;
>>  int status;
>>
>>  result = [calc addDoubleA:a withDoubleB:b]; // #1
>>  result = [calc addDoubleA:a withDoubleB:b status:&status]; // #2
>>  status = [calc addDoubleA:a withDoubleB:b returning:&result]; // #3
>>
>> The examples given here are simple; the items being returned may in
>> fact be pretty complex (and I'm planning on making it so that
>> structured parameters and return values may be passed in Objective C
>> proxies themselves).
>>
>> I really don't like the "addDoubleA:withDoubleB:" name, to be honest,
>> but what am I supposed to do with:
>>
>>  struct ns1__ludcmpResponse {matrix *a; ivector *i; xsd__double d;};
>>  int ns1__ludcmp(matrix *a, struct ns1__ludcmpResponse** result);
>>
>> Like I said; I don't really have any control over the names of the
>> parameters, more's the pity.
>>
>> -austin
>> [1] Actually, they're more like this:
>>  int soap_call_ns__add(struct soap *soap, const char *soap_endpoint,
>>   const char *soap_action, double a, double b, double *result);
>> But there's enough information in there for me to extract the former
>> to use as a proxy function.
>> --
>> Austin Ziegler * [EMAIL PROTECTED] * http://www.halostatue.ca/
>>  * [EMAIL PROTECTED] * http://www.halostatue.ca/feed/
>>  * [EMAIL PROTECTED]
>> ___
>>
>> 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/atze%40freeport.de
>>
>> This email sent to [EMAIL PROTECTED]
>
> ---
> Alexander Spohr
> Freeport & Soliversum
>
> Fax: +49 40 303 757 99
> Web: http://www.freeport.de/
> Box: http://dropbox.letsfile.com/02145299-4347-4671-aab9-1d3004eac51d
> ---
>
>
>
>



-- 
Austin Ziegler * [EMAIL PROTECTED] * http://www.halostatue.ca/
   * [EMAIL PROTECTED] * http://www.halostatue.ca/feed/
   * [EMAIL PROTECTED]
___

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 [EMAIL PROTECTED]


Wrapping C functions in Objective C proxy objects: naming convention?

2008-11-19 Thread Austin Ziegler
For a project that I'm working on, I have a need to write a code
generator that will wrap certain kinds of C functions as Objective C
messages on an Objective C proxy. Because I don't ultimately control
the input, the parameters on the C functions may be poorly named. I'm
looking for advice on how one might make useful object message names
from C functions.

The format of the functions in question is essentially like this[1]:

  int ns__add(double a, double b, double *result);
  int ns__sub(double a, double b, double *result);
  int ns__mul(double a, double b, double *result);
  int ns__div(double a, double b, double *result);
  int ns__pow(double a, double b, double *result);

The int return is a status code; the result of the operation is in
double* result. If there's an error in the operation. (The status code
may be ignorable, in which case part of my following question is
answered; I'm still researching this part. I suspect that it is best
not ignored.)

Anyway, the problem is how I should convert this function with poorly
named parameters into a proxy object and messages?

The options that I've come up with (expressed in terms of use) follow.
They're all expressed in terms of an object ns__CalcProxy:

  ns__CalcProxy calc = [[ns__CalcProxy alloc] init];
  double a, b, result;
  int status;

  result = [calc addDoubleA:a withDoubleB:b]; // #1
  result = [calc addDoubleA:a withDoubleB:b status:&status]; // #2
  status = [calc addDoubleA:a withDoubleB:b returning:&result]; // #3

The examples given here are simple; the items being returned may in
fact be pretty complex (and I'm planning on making it so that
structured parameters and return values may be passed in Objective C
proxies themselves).

I really don't like the "addDoubleA:withDoubleB:" name, to be honest,
but what am I supposed to do with:

  struct ns1__ludcmpResponse {matrix *a; ivector *i; xsd__double d;};
  int ns1__ludcmp(matrix *a, struct ns1__ludcmpResponse** result);

Like I said; I don't really have any control over the names of the
parameters, more's the pity.

-austin
[1] Actually, they're more like this:
   int soap_call_ns__add(struct soap *soap, const char *soap_endpoint,
const char *soap_action, double a, double b, double *result);
But there's enough information in there for me to extract the former
to use as a proxy function.
-- 
Austin Ziegler * [EMAIL PROTECTED] * http://www.halostatue.ca/
   * [EMAIL PROTECTED] * http://www.halostatue.ca/feed/
   * [EMAIL PROTECTED]
___

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 [EMAIL PROTECTED]