-Alloc [[]Init] vs.  New

I'm not sure I'm getting this correctly, but is there a difference between a initializing a receiver with alloc/Init vs. using +(id)new 
Where does the class name argument fit into the +(id)new method?
In either case, once a new instance is returned, does that mean that during runtime the instance of the object will be where the command pointer goes next? And then that instance continues to be available during run until deallocated?
What if you want to have more than one instance of the class available during runtime? Is it better just to initialize one, use it, destroy it, and initialize another, etc, in rapid succession, or better to initialize a quantity of instances, if needed during runtime (if possible)?

There shouldn't be any difference. "[MyClass new]" and "[[MyClass alloc] new]" should be interchangeable. The last time I really tried, I got complaints from either the static analysis and/or leak checker tools when I used "new". I haven't done this test for a long time. I have noticed that in Apple's recent sample code, they are starting to use "new". I hadn't noticed that before. I need to check on this because I think "new" is cleaner and I would prefer to use it if the tools don't complain.
For the record, only autoreleased values get cleaned up. When you do either "alloc, init" or "new", you must release. One alternative is to use a default autorelased initializer. Instead of doing "[[NSMutableArray alloc] init]" and then releasing, you can just do "[NSMutableArray array]". There are similar autoreleased initializers for other classes.

Similar Messages

  • New versus alloc-init

    Is there any semantic difference between, for example,
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    and
    NSAutoreleasePool * pool = [NSAutoreleasePool new];
    Why would alloc and init be used in Apple's documentation examples and code templates rather than the more concise new where there are no init arguments? I happened upon new while browsing the class methods of NSObject.

    alloc-init and new are the same as far as I know. I try to use new when I can. The only plausible explanation I've heard is that Apple wants people to use the concept of "resource acquisition is initialization". That is, they prefer you get in the habit of using one of the other init* functions instead. I have seen people get into the habit of creating lots of objects and then having to create a whole separate initialization phase.
    I try to create and use init* functions whenever I can. But if I just want alloc-init, I use new.

  • Global alloc init declaration

    Is there anyway to do a global alloc init so all functions in a class can see it?
    any help is appreciated
    pheonixfire

    okay, here it is:
    -(void) connectAction:(id)sender
        sshServer *server = [[sshServer alloc] init];
        sshConnector *connection = [[sshConnector alloc] init];
        address *destination = [[address alloc] init];
        if ([[connect stringValue] isEqualToString:@"Connect"])
            [addressOutput setStringValue:[destination destinationAddress]]; //to check the destination address
            NSMutableString *address;
            address = [destination destinationAddress];
            [server setSSHHost:address port:22 user:[username stringValue] key:@"" keypub:@"" password:[password stringValue]];
            [connection connect:server];
    -(IBAction)PlaySongAction:(id)sender
        [sshOperator execCommand:@"nightingale -play" sshServer:server];
    the ssh stuff comes from here:
    http://thebsdbox.co.uk/?p=257
    any help is appreciaed
    pheonixfire

  • IM Init with new ECC and BI Production start up

    Hi Everyone:
    We have a new BI and new ECC going live.  There will be a period of downtime in the production ECC box after conversions are done. This will be just prior to golive time.    Is it ok to go ahead and do the 3 inits for IM with ECC to BI before the boxes are up and being used?  We have done this before on another project without any problems but I just need some confirmation for my peace of mind on this.  Thx

    Hi,
    In r/3 side ok when ever u rcoping from one systme to another for example if u take r/3 production to r/3 quality now the entire system will be copied as like production in r/3
    now in bw quality is asconnected to r/3 quality once ur copied the logical system every thing cahnegd in quality r/3 but before copy the system is connected with different logical system.
    hence it is better to chnage logical system after copying from production to quality.
    now u take BW side,yes what u said is write it is tottlly coping system if u r refereshed the system automatically the production system will be copied in quality all delta process will come to quality
    so once u r refreshed teh quality r/3 then it si better to once again replicate the qualty sasyte(after coping productionr/3) the do the copy of bw production to quality.
    Thanks & Regards
    Sathsih

  • (V9I) ORACLE 9I NEW FEATURE : RESUMABLE SPACE ALLOCATION

    제품 : ORACLE SERVER
    작성날짜 : 2002-11-01
    (V9I) ORACLE 9I New Feature : Resumable Space Allocation
    =====================================================
    PURPOSE
    Oracle9i New Feature 인 Resumable Space Allocation 에 대해
    알아보도록 한다.
    Explanation
    Resumable Space Allocation 은 다음과 같은 새로운 Space allocation
    이 발생되어야 할 시점에 에러를 바로 발생하지 않고 어느정도의 Time 을 준뒤
    Admin에게 이를 알림으로써 수행중인 Transaction rollback 되지 않고 계속적으로
    진행할 수 있도록 하는 기능이다.
    Query 수행시 다음과 같은 원인으로 에러가 발생하면서 query 수행이 중지된다.
    1) Out of space condition
    2) Maximum number of extents reached condision
    3) Space quota exceeded condition
    그러나 9I 에서 Resumable Space Allocation Operations을 설정하게 되면
    alertSID.ora file에 suspend 되는 메세지와 함께 설정한 timeout 까지 hang 상태가
    발생된다. 만약 timeout 초과시엔 에러가 발생하면서 transaction은 rollback 된다.
    alertSID.ora 메세지예)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    Example
    다음은 Resumable Space Allocation Operations 을 설정하기 위해서는 RESUMABLE 을
    ENABLE 시키고 또는 DBMS_RESUMABLE package를 이용한다.
    1) RESUMABLE system privilege 부여
    SQL> connect system/manager
    Connected.
    SQL> grant resumable to scott;
    Grant succeeded.
    2) session level에서 RESUMABLE enable 시키기
    SQL> alter session enable resumable;
    Session altered.
    This can be set automatically through an AFTER LOGON trigger.
    SQL> create or replace trigger logon_set_resumable
    2 after logon
    3 on scott.schema
    4 begin
    5 execute immediate 'alter session enable resumable timeout 1200';
    6 end;
    7 /
    Trigger created.
    3) 생성한 TEST_RESUMABLE table 에 insert 작업
    -> insert 시에 hang 현상 발생(transaction rollback은 이루어지지 않는다.)
    -> alert.log에 suspend message 확인
    -> 만약 설정한 timeout 초과시 에러 발생되면서 transaction rollback
    a. Displaying the DBA_RESUMABLE view(DBA_RESUMABLE view에서 suspend 확인)
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, SUSPEND_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME SUSPEND_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 SUSPENDED 03/14/01 10:49:25 03/14/01 11:14:17
    insert into test_resumable select * from test_resumable
    1631
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    b. In alert.log file(alert.log에서 message 확인)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    c. The statement may issue the following error when the timeout set for the
    session has expired(timeout 초과시 transaction rollback 되면서 에러 발생)
    SQL> insert into test_resumable values (1);
    insert into test_resumable values (1)
    ERROR at line 1:
    ORA-30032: the suspended (resumable) statement has timed out
    ORA-01536: space quota exceeded for tablespace 'EXAMPLE'
    4) The DBA now knows why the session hangs, and needs to find which action to
    take to alleviate the ora-1631 error(DBA는 timeout 이 발생하기 전에 에러 발생)
    SQL> connect system/manager
    Connected.
    SQL> alter table scott.test_resumable storage (maxextents 8);
    Table altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME RESUME_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 NORMAL 03/14/01 10:49:25 03/14/01 11:24:02
    insert into test_resumable select * from test_resumable
    0
    5) If the session does not need to be in resumable state, the session can
    disable the resumable state(더이상 resumable 기능 사용하지 않을 경우 disable 시키기)
    SQL> alter session disable resumable;
    Session altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    no rows selected
    Reference Document
    Note. 136941.1 Using RESUMABLE Session to Avoid Transaction Abort Due to Space Errors

    제품 : ORACLE SERVER
    작성날짜 : 2002-11-01
    (V9I) ORACLE 9I New Feature : Resumable Space Allocation
    =====================================================
    PURPOSE
    Oracle9i New Feature 인 Resumable Space Allocation 에 대해
    알아보도록 한다.
    Explanation
    Resumable Space Allocation 은 다음과 같은 새로운 Space allocation
    이 발생되어야 할 시점에 에러를 바로 발생하지 않고 어느정도의 Time 을 준뒤
    Admin에게 이를 알림으로써 수행중인 Transaction rollback 되지 않고 계속적으로
    진행할 수 있도록 하는 기능이다.
    Query 수행시 다음과 같은 원인으로 에러가 발생하면서 query 수행이 중지된다.
    1) Out of space condition
    2) Maximum number of extents reached condision
    3) Space quota exceeded condition
    그러나 9I 에서 Resumable Space Allocation Operations을 설정하게 되면
    alertSID.ora file에 suspend 되는 메세지와 함께 설정한 timeout 까지 hang 상태가
    발생된다. 만약 timeout 초과시엔 에러가 발생하면서 transaction은 rollback 된다.
    alertSID.ora 메세지예)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    Example
    다음은 Resumable Space Allocation Operations 을 설정하기 위해서는 RESUMABLE 을
    ENABLE 시키고 또는 DBMS_RESUMABLE package를 이용한다.
    1) RESUMABLE system privilege 부여
    SQL> connect system/manager
    Connected.
    SQL> grant resumable to scott;
    Grant succeeded.
    2) session level에서 RESUMABLE enable 시키기
    SQL> alter session enable resumable;
    Session altered.
    This can be set automatically through an AFTER LOGON trigger.
    SQL> create or replace trigger logon_set_resumable
    2 after logon
    3 on scott.schema
    4 begin
    5 execute immediate 'alter session enable resumable timeout 1200';
    6 end;
    7 /
    Trigger created.
    3) 생성한 TEST_RESUMABLE table 에 insert 작업
    -> insert 시에 hang 현상 발생(transaction rollback은 이루어지지 않는다.)
    -> alert.log에 suspend message 확인
    -> 만약 설정한 timeout 초과시 에러 발생되면서 transaction rollback
    a. Displaying the DBA_RESUMABLE view(DBA_RESUMABLE view에서 suspend 확인)
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, SUSPEND_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME SUSPEND_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 SUSPENDED 03/14/01 10:49:25 03/14/01 11:14:17
    insert into test_resumable select * from test_resumable
    1631
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    b. In alert.log file(alert.log에서 message 확인)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    c. The statement may issue the following error when the timeout set for the
    session has expired(timeout 초과시 transaction rollback 되면서 에러 발생)
    SQL> insert into test_resumable values (1);
    insert into test_resumable values (1)
    ERROR at line 1:
    ORA-30032: the suspended (resumable) statement has timed out
    ORA-01536: space quota exceeded for tablespace 'EXAMPLE'
    4) The DBA now knows why the session hangs, and needs to find which action to
    take to alleviate the ora-1631 error(DBA는 timeout 이 발생하기 전에 에러 발생)
    SQL> connect system/manager
    Connected.
    SQL> alter table scott.test_resumable storage (maxextents 8);
    Table altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME RESUME_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 NORMAL 03/14/01 10:49:25 03/14/01 11:24:02
    insert into test_resumable select * from test_resumable
    0
    5) If the session does not need to be in resumable state, the session can
    disable the resumable state(더이상 resumable 기능 사용하지 않을 경우 disable 시키기)
    SQL> alter session disable resumable;
    Session altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    no rows selected
    Reference Document
    Note. 136941.1 Using RESUMABLE Session to Avoid Transaction Abort Due to Space Errors

  • Object allocations, memory and UINavigationController

    I'm having a problem with object allocations
    Is it possible to release/remove a view from a navigation controller stack when I click on the back button on my navigation controller? I wish to get rid of the view I just left (the one disappearing to the right of the screen). The problem is that the next time I navigate to the same view lots of new objects are allocated, and none of the old ones are released.
    In the tableView:didSelectRowAtIndexPath: method I initialize a new view controller for the view I want to push to the stack and assign it to a property. The problem is that the old view seems to continue to exist in the navigation controller stack, because it's never released according to the "object allocation" section in Instruments, thus the amount of allocated objects and memory just grows and grows as I click back and forth in my navigation controller.
    For example, if I click on a cell in the first table view (which displays a second view) and then click on the back button and then click on the first cell again, the second view and all of its objects are created again, but the previous instance of this view seems to still exist somewhere in the navigation controller stack.
    What's the best way to solve this?
    Here's some of the code in the "tableView:didSelectRowAtIndexPath:" method:
    self.categoryController = [[CategoryViewController alloc] init];
    self.categoryController.category = category;
    [self.navigationController pushViewController: self.categoryController animated:YES];
    Each time this code is executed tons of new objects are allocated, but the objects allocated by the previous CategoryViewController are not released.

    Thanks you so much for the great article!!
    cotton.m!!
    I can cheat on my assignment again, haha!
    strange
    Stepwise Refinement :|
    http://forum.java.sun.com//thread.jspa?threadID=5206258

  • [iPhone SDK] Truncating NSDates ; Init NSDateComponents from a NSDate

    In my application, I have to truncate some of the components of an NSDate, so I can do comparisons.
    Basically I am initializing a new NSDate as NOW. So that gives me Minutes, Seconds, Sub-Seconds.
    In my current application, I need to ZERO OUT the Seconds, Sub-Seconds.
    For the Minutes, I need to evaluate the minutes. If it is after the 30 minute mark, I have to roll it back to 30. If it is between 0 and 29, I have to roll back to 0.
    So I need truncate the time to 00 or 30 for the minutes (Day, Hours are not impacted, but the theory is the same if I need to truncate to the week, month, year)
    I have been looking and can't find a NSDate truncation method, or other class that will do it for me.
    On another forum, they directed me to the NSDateComponents class. Which I probably could use for what I am doing.
    The problem I am running into with that class, is initializing it to a specific date (or even NOW directly).
    Since on the iPhone I can't use NSCalendar most of the examples of extracting the different components of an NSDate are not available (since they seem to use the NSCalendar functions).
    So I can't even brute force initialize the date directly.
    The only way I have been able to do is is using a NSDateFormatter which is so overkill, I'll stick with my original method of doing it (which is ~slow~).
    So anyone have any other ideas for my above situations?
    Or if the Apple guys are reading this: Two things would be very helpfull.
    -) A method on the NSDate that would truncate to a specific type (Year, Month, Week, Hour, Minute, Second, with an option to round up/down to a specific integer value)
    -) A method on the NSDateComponents to initialize FROM an NSDate, or from NOW

    All right, I did some research, and hopefully I've got it right. Here's how it would be done, and I'll tell you what I'm doing line by line:
    NSDate *date = [NSDate date];
    NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
    Creates a new date and new date components. The NSDate is set to now.
    dateComponents = [dateComponents components:NSYearCalendarUnit fromDate:date];
    This sets the date components to the date components with the date that you specified's current year, I think, but I'm not sure. You can look up NSCalenderUnit and the components:fromDate: method for more information on it.

  • New window closing as soon as I move the mouse

    I'm sure this is an issue of not connecting something properly in InterfaceBuilder but I just can't see what it is. I create a new window like:
    MyWindowController *c = [[[MyWindowController alloc] init] initWithWindowNibName:@"Preferences"] autorelease];
    [c showWindow:nil];
    The window opens fine and the controller gets both the initWithWindow and windowDidLoad messages. But as soon as I move the mouse the window closes. The controller doesn't get the windowWillClose message even though the controller is set as the window delegate.
    I have a similar window and controller that opensand works fine.  Any ideas on what I forgot to connect up?

    This really isn't an iPod problem. I think you have a device conflict that is effecting your USB ports. I'm trying to put on my XP hat and remember how to check this. (without a XP machine close by, all bets are off on my memory)
    Open Control Panel and look for Install/Remove Hardware. After that opens, there should be a tab that lists device drivers. Open that up and scan down to USB ports. If there is a conflict you should see a ? in yellow.
    The real question is how to fix it. You could look for updates to your USB drivers and that might do it or you may have to look at the Apple Mobile Device Service and see what is going on there.
    http://support.apple.com/kb/TS1567
    Hope that helps but I think a device conflict is the probable cause.

  • New page of information

    Hi
    I was looking for a way to search though a list of items the other day and was very lucky to get some great help here so thanks a lot for that.
    I have a list of "places" say, and can search though them at the top which works great. I have built some pages that when you click on one of the options i would like the page to come up. I.E you click on America - New York and the slide all about New York comes up. The tut that I used was this one here http://developer.apple.com/iphone/library/samplecode/TableSearch/index.html
    Thank you for your help!

    Rusty149 wrote:
    how do you link an option from the first page of data to another more detailed page
    Ok, Rusty. Your question is much more general than I thought. The TableSearch sample app assumes you understand how both UITableView and UINavigationController operate, and how to write the code to customize them. The door to the next page you're looking for is in this TableSearch method (which is one of the UITableViewDelegate methods):
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    // The following statement creates the view controller whose view will be displayed
    // when you make a selection from the table view. However the controller which is
    // created here is generic. It's your job to substitute a custom controller class here
    // which will know how to display the page you want. Therefore it's also your job
    // to provide the new controller with enough info about the selection so it can find
    // the correct images and/or text, setup the right controls, etc.
    UIViewController *detailsViewController = [[UIViewController alloc] init];
    If the requesting table view is the search display controller's table view, configure
    the next view controller using the filtered content, otherwise use the main list.
    Product *product = nil;
    if (tableView == self.searchDisplayController.searchResultsTableView)
    product = [self.filteredListContent objectAtIndex:indexPath.row];
    else
    product = [self.listContent objectAtIndex:indexPath.row];
    // The next line is where the new view controller gets information
    // about the table view selection. In this case the info is only used
    // to set the title you'll see on the nav bar. But your custom view
    // controller could make other use of this name (e.g. to load a
    // like-named image file).
    detailsViewController.title = product.name;
    // The next line causes the actual transition to the new view (page).
    // We say the new view controlled is "pushed" onto the nav controller's
    // "stack". A stack is like a pile of papers. You can only see the
    // page on top. When we add a page to the pile it's called a push.
    // When we take the top page off the pile it's called a pop. Note that
    // if the new page is blank, it's your job to make the page more
    // interesting.
    [[self navigationController] pushViewController:detailsViewController animated:YES];
    [detailsViewController release];
    If the above doesn't make much sense to you, I would recommend a good book on the SDK. The one I like the most is +Beginning iPhone Development: Exploring the iPhone SDK+ by Mark and LaMarche. Chapter 8 is all about table views and Chapter 9 shows you how to use navigation views with table views to make exactly the kind of structure you're asking about in this thread. The chapters prior to those are very clear with lots of fun projects and fully explained code. By the time you finish the projects in Chapter 9, you'll be able to write a useful app all by yourself.
    - Ray

  • Warning: (Insert object here) may not respond to '+alloc' ?

    I'm just getting started with Objective C development, and the following example that I am working with results in the following error:
    fraction.m:6: warning: ‘Fraction’ may not respond to ‘+alloc’
    fraction.m:6: warning: (Messages without a matching method signature
    fraction.m:6: warning: will be assumed to return ‘id’ and accept
    fraction.m:6: warning: ‘...’ as arguments.)
    fraction.m:6: warning: no ‘-init’ method found
    fraction.m:8: warning: ‘Fraction’ may not respond to ‘-free’
    I am running Snow Leopard, and I have downloaded the most recent XCode and iPhone dev libraries.
    I would very much appreciate your input. Thank you.
    ==========
    #import <stdio.h>
    #import <objc/Object.h>
    /* Interface */
    @interface Fraction: Object
    int numerator;
    int denominator;
    -(void) print;
    -(void) setNumerator: (int) n;
    -(void) setDenominator: (int) d;
    -(int) numerator;
    -(int) denominator;
    @end
    /* Implementation */
    @implementation Fraction;
    -(void) print
    printf ("%i,%i", numerator, denominator);
    -(void) setNumerator: (int) n {
    numerator = n;
    -(void) setDenominator: (int) d {
    denominator = d;
    -(int) numerator {
    return numerator;
    -(int) denominator {
    return denominator;
    @end
    int main (int argc, char *argv[])
    Fraction* myFraction = [[Fraction alloc] init];
    [myFraction free];
    return 0;
    }

    tkambler wrote:
    I've determined that this script compiles just fine on my iMac running 10.5.8. My other iMac, which I just installed Snow Leopard on, is the one that is giving me the errors. Any thoughts?
    Fraction.m compiled and ran under Xcode without any problems on my OS X 10.5.5 system. I don't have a Snow Leopard system, so can't reproduce the errors you reported.
    My first guess would be that the difference in your two systems is a difference in the included Object.h file. On my system the included file lives in /Developer/SDKs/MacOSX10.5.sdk/usr/include/objc. That @interface does indeed declare alloc, init, free, etc.
    From the compiler warnings you posted (which don't include "Can't find Object.h"), I would assume that either the Object.h file at the above path has changed, or that the wrong Object.h file is being included. The latter needs to be ruled out because (at least on my system) there are several Object.h files intended for different purposes. So for example, if your Snow Leopard Xcode isn't searching in the same folders, or if the correct Object.h has been relocated, it's entirely possible the wrong file is being included during the build.
    Determining which possibility applies in your case may require some familiarity with OS X and Xcode, and I don't know if +just getting started with Objective C+ means just that, or whether OS X and all of the developer tools are also new for you. If the code you posted is part of an isolated exercise and you won't be using Object.h much in the future (since it's not used in Cocoa), my advice would be to stay on the system that works until you're done with the current exercise.
    If you have a requirement to program in Obj-C without using Cocoa for an extended period of time, I'm sure someone here can help you find out what happened to Object.h on your Snow Leopard system. Of course things will be a lot easier if that help comes from someone who already has Snow Leopard.
    You can get started by looking at the Object.h file Xcode is including. You can do this by selecting Object.h in a text editor window, then selecting File->Open Quickly from the top menu (see Opening Files by Filename or Symbol Name in the Xcode Workspace Guide). Is your Active SDK set to 10.6? If your Snow Leopard Xcode has the option to set the Active SDK to 10.5, see which Object.h file gets included in that case.
    Hope that helps!
    \- Ray

  • No New Batch number creation at the time of Material Transfer Movement(309)

    We are upgarding from 4.6C to ECC6.0. We have an issue in regards with the material movement type 309. At the time of creating the material tranfer using the same material as issuer and receiver, the same plant and storage location ( this process is used by the business to diferentiate batches).
    In 4.6C a new batch number is created automatically when 309 movement is posted; stock and characteristics transfered are allocated at the new batch created automatically.
    The same case in ECC6.0 does not create a new batch as done in 4.6C. We have looked for any SAP note or forum discussion without success.
    If anybody has an answer for this issue, let us know.

    As a matter of fact these configuration has been checked before, additionally we compare configuration at 4.6C and ECC6.0 and it is the same but the new batch creation (for this specific case) is working at 4.6C, not at ECC6.0.

  • Where to add new script in an ActionScript file

    Hi,
    moved to AS3 forum
    I am a newbie using Flash Pro CS5 and have beginner skills in AS3.
    I am working on an eLearning lesson and already, with a lot of earlier help of others, and have an Action Script file to use for a white noise  animation in a learning lesson.
    I need to make a couple of additions but am very unfamiliar with adding  script to an Action Script file "package." Specifically, I want to add a  URL checking to the Action Script file so that students do not view the  Flash movie animation outside of the lesson which contains learning  materials and instructions for using the animation.
    I would like to add the following script but so far, I have been getting error messages:
    if ((this.loaderInfo.url).indexOf("mywebsite. com") == -1)
                navigateToURL (new URLRequest ("http://mywebsite.com/default.html"));
                else
    //run the animation
    The current AS3 in the .as file is:
    package
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.events.TimerEvent;
        import flash.geom.Matrix;
        import flash.geom.Point;
        import flash.utils.getTimer;
        import flash.utils.Timer;
        public class Main extends Sprite
            private var viewbmd:BitmapData;
            private var workbmd:BitmapData;
            private var scaleUp:Matrix;
            private var px:Vector.<uint>;
            private var timer:Timer;
            private var itsNoisy:Boolean;
            public function Main():void
                if (stage) init();
                else addEventListener(Event.ADDED_TO_STAGE, init);
            private function init(e:Event = null):void
                removeEventListener(Event.ADDED_TO_STAGE, init);
                viewbmd = new BitmapData(stage.stageWidth, stage.stageHeight, false);
                var view:Bitmap = new Bitmap(viewbmd);
                addChild(view);
                workbmd = new BitmapData(viewbmd.width / 8, viewbmd.height / 8, false);
                scaleUp = new Matrix();
                scaleUp.scale(8, 8);
                itsNoisy = true;
                stage.addEventListener(MouseEvent.CLICK, manageNoise);
                initNoise();
                timer = new Timer(50);
                timer.addEventListener(TimerEvent.TIMER, onTick);
                timer.start();
            private function initNoise():void {
                var array:Array = [];
                for (var i:uint = 0; i < 255; i++) {
                    array[i] = 0xffffff * (i % 2);
                workbmd.noise(getTimer(), 0, 255, 7, true);
                workbmd.paletteMap(workbmd, workbmd.rect, new Point(0, 0), array, array, array);
                px = workbmd.getVector(workbmd.rect);
            private function onTick(e:Event):void {
                flipSomePixels(160);
                viewbmd.draw(workbmd, scaleUp);
            private function flipSomePixels(howMany:int):void {
                for (var i:int = 0; i < howMany; i++){
                var pxidx:int = Math.floor(Math.random()*px.length);
                    px[pxidx] = ~px[pxidx]; //bitwise NOT to flip all bits
                workbmd.setVector(workbmd.rect, px);
            private function manageNoise(e:MouseEvent):void {
                itsNoisy ? timer.removeEventListener(TimerEvent.TIMER, onTick) : timer.addEventListener(TimerEvent.TIMER, onTick);
                itsNoisy = !itsNoisy;
    If anyone can take a look and please let me know how to add the  additional script to check for the URL (please be specific since I am a beginner in  scripting):
    I have tried everything that I can think of and am stuck.
    Thanks in advance for your help.
    Kind Regards,
    saratogacoach

    in your constructor:
    if (this.loaderInfo.url.indexOf("mywebsite.com") == -1) {
        navigateToURL(new URLRequest ("http://mywebsite.com/default.html"));
    } else {
        addEventListener(Event.ADDED_TO_STAGE, init);

  • How to AP recon. account  balance transfer to new recon. account

    Hi gurus,
    I have to transfer old recon. balance to new created recon. account. how can i do this? can anybody help me to work out this issue?
    Than'x
    Dhananjay R.

    Hi,
    check this out:
    BR Tarik
    Change the reconciliation account of the customers/vendoers:
    Account has been posted to; hold balance sheet adjustment
    Message no. F2067
    Diagnosis
    The open item account in which you want to change the reconciliation account has been posted to.
    By changing the reconciliation account in the open item master record the proportionate values from the items open at the time of change are not posted to the new reconciliation account.
    Procedure
    On the balance sheet key date the open items from the old reconciliation account are allocated to the new reconciliation account using adjustment accounts. This allocation is carried out automatically when you create a sorted list of receivables and payables using report SAPF101.
    The postings necessary are only carried out for G/L accounts and are cancelled on the first day of the subsequent month (balance sheet adjustment posting).

  • Providing init parameters to a servlet portal component

    I'm creating a portalcomponent based on a servlet. So I have the following declaration in my portalapp.xml:
          <component-config>
            <property name="ComponentType" value="servlet"/>
            <property name="ClassName" value="test.TestServlet"/>
    Now I want to provide standard init-parameters (as defined in a servlets' web.xml) to this servlet, but I can't find any documentation describing how to do this. Standard profile parameters do not get through to the ServletConfig or ServletContext.
    Any help will be appreciated.
    Regards,
    Marnix

    seems simple enough right
    but i don't get this to work.
    private Vector parameterNames = null;
    public void init(){
    parameterNames = new Vector();
    for(Enumeration e = this.getInitParameterNames(); e.hasMoreElements() ;) {
    parameterNames.add(e.nextElement());

  • Error with making new buttons

    Here is the code, in the code I have created a new button called ClickToPlay. Though when I compile this code I receive an error telling me that it cannot find symbol
    symbol: constructor Button(java.lang.String)
    location: class Button
    ClickToPlay = new Button("Click her to play");
    Please, someone try to find the error and help me out here, here is the code.
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    public class DrakonTitle extends Applet implements Runnable
         Font bigFont;
         Font NotSoBig;
         int xPos = 100;
         int yPos = 200;
         int radius = 20;
         Image ScreenChar;
         URL base;
         MediaTracker mt;
         private Image dbImage;
         private Graphics dbg;
         public void init()
         mt = new MediaTracker(this);
         bigFont = new Font("Arial",Font.BOLD,100);
         NotSoBig = new Font("Arial",Font.BOLD,30);
         Button ClickToPlay;
         ClickToPlay = new Button("Click here to play");
         add(ClickToPlay);
         try
              base = getDocumentBase();
         catch(Exception e) {}
         ScreenChar = getImage(base,"FrontScreenCharacter.jpg");
         mt.addImage(ScreenChar,1);
         try
              mt.waitForAll();
         catch(InterruptedException e)
         public void start()
              Thread th = new Thread(this);
              th.start();
         public void stop()
         public void update (Graphics g)
         if (dbImage == null)
         dbImage = createImage (this.getSize().width, this.getSize().height);
         dbg = dbImage.getGraphics ();
         dbg.setColor (getBackground ());
         dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
         dbg.setColor (getForeground());
         paint (dbg);
         g.drawImage (dbImage, 0, 0, this);
              public void destroy()
              public void run()
                   while(true)
                        xPos++;
                        repaint();
                        try
                             Thread.sleep(17);
                        catch(InterruptedException ex)
         public void paint(Graphics g)
              g.setFont(bigFont);
              g.drawString("Drakon:",45,100);
              g.setFont(NotSoBig);
              g.drawString("Lord of Lords",100,160);
              g.drawImage(ScreenChar,xPos-radius,yPos-radius,2*radius,2*radius,this);
    }

    It is likely that you have a Button class on your computer that is not java.awt.Button and javac is finding this class. If you add "import java.awt.Button;" or change the line to "java.awt.Button ClickToPlay" and "ClickToPlay = new java.awt.Button......" it should work.

Maybe you are looking for

  • Mechanism for monitor java application or JVM

    Ladies & Gentleman, I develop Java application under Windows 2000 datacenter. For gurantee to capture all of abnormal situation of java application and also JVM, I need to know how to capture the situation. Do any other tools to do these things? I am

  • Early 2009 Mac Pro CPU upgrade

    Hello all I just purchased a 2009 2.66 quad core Mac Pro. I am wondering if the CPU is upgradable. Since the new CPU sits on a slide out tray and shares the same CPU socket as the 8 core CPUs. Can a user upgrade the CPU later? Say if I want to upgrad

  • Vista SP1, ALchemy1.0.0.3 and Warcraft III

    when update to Vista SP,if i make ALchemy.0.0.3 for Warcraft III enabled, the game can't open.but work fine in Vista RTM. sorry for my english.

  • Need help with uisng quantities and currencies HELP

    I have some qunatity and currencies fields that i am filling in via the user exit.  I've paced the UOM in the append sturcture and had the quantity field reference these but the UOM keeps coming of empty.  what am i doing worng?

  • Data and time characteristics found in character and keyfigures?

    hi all, I can find date and time found in both characteristics and keyfigures. Can anyone tell me in which scenario we shall select date and time considered in characteristics and when shall we select date and time for keyfigures. can anyone explain