Very basic Objective-C Question

Okay, I am completely new to Objective-C so forgive me.
I am trying to run a command when the MainView is initially loaded, so I figured I would need to override the constructor. I tried overriding init and initWithFrame, but it didn't work.
How can I get a command to run (sendDate = [NSDate date];) when the UIView is initially loaded?
Thanks a bunch.

Let's take a step back for a second. Are you using Interface Builder (IB) with XViewController?
Usually with a UIViewController there is no separate UIView class. At least not with the code I've written. A view controller creates its own view. If using IB then the view is created from the XIB file. There is no actual UIView class on the file system or in your project.
So what ends up happening is the UIViewController loads the view and the view controller's 'viewDidLoad' method gets called. It is usually here that you finish off setting up the view. You access the view using 'self.view' inside the view controller code.
But you seem to have an actual class named MainView that is a UIView. And it appears that class has an instance variable of 'sendDate'. Did you create this class by hand? If so then you must have explicit code for creating it. Where is this code?
This is one of those details that I could explain is 5 seconds in person after seeing what you were doing. But online I can't, of course, see what you are really doing.

Similar Messages

  • A very basic editor related question

    Dreamweaver is considered a versatile & matured HTML editing tool, but (surprisingly) I could not find a very basic HTML editing facility in Dreamweaver (which is found in some free tools like Aptana Studio).
    In the code editor, if I click on a HTML (starting) tag, the editor should highlight the end tag, but the Dreamweaver editor does not do that? Am I missing anything?
    (I am using Dreamweaver CS3)

    In Code View you have some icons on the left side of your screen.  These can be used to expand and collapse sections of code for easier viewing.
    < > Select Parent Tag.  See screenshot.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • Very Basic Objective-C issue, I am sure

    So I picked up a book on ojective-c namely Mr. Kochan's, and have been trying to work through the exercises and examples. I ran into my first problem that I haven't been able to solve myself. The error says that the object I tried to create "point" is being redeclared as a different type of symbol. Although I can swear I have the section from the book copied almost verbatim, I am sure I am doing something overtly wrong, but I still can't find it. Any suggestions would be greatly appreciated.
    Thanks in advance!
    Here is the code I am working with sans the header:
    #import <stdio.h>
    #import <objc/Object.h>
    //--------------Interface Section----------
    @interface Point: Object
    int hcoord;
    int vcoord;
    -(void) print;
    -(void) setHcoord: (int) x;
    -(void) setVcoord: (int) y;
    @end
    //-------- Implementaion Section-------------
    @implementation Point;
    -(void) print
    printf (" %i,%i", hcoord, vcoord);
    -(void) setHcoord: (int) h
    hcoord = h;
    -(void) setVcoord: (int) v
    vcoord = v;
    @end
    //--------- program section------------
    int main (int argc, char *argv[])
    Point *point1 = [[Point alloc] init];
    [point1 setHcoord: 4];
    [point1 setVcoord: 5];
    printf ("The cartesian coordinates for point 1 are:");
    [point1 print];
    printf ("\n");
    [point1 free];
    return 0;
    12" Powerbook   Mac OS X (10.4.7)  

    OK. I think I see what's going on. Point is already declared in the Core Foundation, which is included in your project. If you're following the directions on page 10 of Kochan's book, they're kind of out of date.
    I can get your program to build and run if I follow these steps:
    1. Create a new project in Xcode. But instead of choosing a "Cocoa Application" like the book says, scroll down to the section that says "Command Line Utility". You want a "Foundation Tool".
    2. In your "Source" folder in Xcode, you'll see two files, one with ".m" on the end, the other with "Prefix.pch" at the end. Open the ".m" file and replace everything with your code. Close and save the ".m" file.
    3. Now, open the other file (the one ending with "_Prefix.pch" in your "Source" folder. There is a comment at the top, then three lines:
    <pre class="command">#ifdef _OBJC_
    #import <Foundation/Foundation.h>
    #endif</pre>Comment out those three lines like so:
    <pre class="command">//#ifdef _OBJC_
    // #import <Foundation/Foundation.h>
    //#endif</pre>Your project should compile and run. Alternatively, since Point is already defined, you can just change the name from Point something else.
    Instead of step 3 above, just replace Point with something like MyPoint. Even just changing the "P" to a lower case "p" is enough to fix it.
    charlie
    P.S. -- If you haven't already visited, I suggest checking out Steve Kochan's page for that book. Pay special attention to the Errata section. There are some errors in the book and the corrections are there, so that's a good resource.

  • Very basic initial configuration question.

    Hi.
    I replaced a Catalyst 2960G for a C2960X-24-L in a network where there are already five switches.
    I have no idea how to assign it an ip : is there anyone here willing to explain that in  very simple way ?
    I tried plug it in the existing network, but didn't work.
    I'm not the one whom installed the network, and I'm doing that to help.
    Thank you.
    Pierre

    Also if you are adding a new sw to the network i recommend you to reset the vtp in that sw (if your network has it.) if you are not sure just do "vtp mode transparent" "vtp mode client" assuming that you are replacing a client sw.
    Then you should verify before connecting to the network:
    - type of stp that your network is running
    - if you have vtp check the config and use the same domain, version, password so the sw gets the vlans from the 
    - when you have all the vlans set in the sw then add the interfaces to the vlans
    - be sure that you are not replacing the root sw.
    Maybe there are others things to check but thats what comes to my mind now
    Regards

  • Very Basic ISA 2006 Question

    I am the first to admit that I don't really know anything about ISA....so please forgive me if this question is too stupid for words.....(and if a particular MVP with the initials 'AF' is reading this, then yes, I know I am incredibly stupid and shouldn't have
    anything to do with networks, and me posting to these forums is an offence to your sensibilities etc etc, so spare me the rant this time...)
    Anyway, I was under the impression that with ISA server you could have a number of web sites all running off the same IP address. For example, we have 2 websites (site1.company.com and site2.company.com) and 1 external IP address. We have DNS records set up
    for each of these sites, and they both point to our external IP address. What I thought happened (in my incredibly uneducated mind) was this
    1. User types www.site1.company.com into their browser, which resolves to our external IP address on our firewall. Our firewall forwards this request to our ISA s2006 server. The ISA server reads the 'site1.company.com'
    in the request and forwards the traffic to webserver1.
    2. User types www.site2.company.com into their browser, which resolves to our external IP address on our firewall. Our firewall forwards this request to our ISA s2006 server. The ISA server reads the 'site2.company.com'
    in the request and forwards the traffic to webserver2.
    Are my assumptions correct, or do we need a public IP address for every site we wish to publish?

    Hi,
    you are correct. It is possible to publish multiple websites with one public IP address:
    http://support.microsoft.com/kb/838252/en-us
    http://blogs.technet.com/b/isablog/archive/2008/06/19/another-look-at-web-publishing-part-ii-host-headers-with-ssl-and-certificates.aspx
    regards Marc Grote aka Jens Baier - www.it-training-grote.de - www.forefront-tmg.de - www.galileocomputing.de/3570

  • Very basic user, simple question (i think)

    Hi there,
    Very new to dreamweaver, im making a website at the moment, what i dont understand is i have a set template, which i have used for about 6 pages within the website.  On all the pages it is very zoomed in when i preview it in chrome, apart from one page, this page looks perfect, its in perspective and everything isnt too large like on the others.  Is there a way i can make them all follow this one?
    Nevermind that, sorted that
    How do i set the zoom of the page, so when anyone goes onto the page it appears in the correct zoom, rather than far too zoomed in like it does now

    Newtimething wrote:
    Nevermind that, sorted that
    How do i set the zoom of the page, so when anyone goes onto the page it appears in the correct zoom, rather than far too zoomed in like it does now
    Not a clue what your'e talking about. Is the browser set to zoomed by default? Sometimes it can be set in the last position you use it at so you need to re-set it, that' a possibility

  • Very basic SQL/XML question

    I'm using the following environment:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    However, I don't think my environment is the issue.
    I'm trying to get output which looks like this from a simple table:
    <MAXDOMAIN action="S">
         <DOMAINID key="true">domainid_data</DOMAINID>
         <SYNONYMDOMAIN type="relationship" action="AU" >
              <VALUE key="true">value_data</VALUE>
              <MAXVALUE>maxvalue_data</MAXVALUE>
              <DESCRIPTION>description_data</DESCRIPTION>
              <DEFAULTS>defaults_data</DEFAULTS>
         </SYNONYMDOMAIN>
    </MAXDOMAIN>The table looks like this
    Name                           Null     Type          
    DOMAINID                       NOT NULL VARCHAR2(30)   
    DESCRIPTION                             VARCHAR2(50)   
    DOMAINTYPE                              VARCHAR2(5)    
    MAXTYPE                                 VARCHAR2(5)    
    LENGTH                                  VARCHAR2(5) The real question is how do I get an element with attributes to also have content.
    <DOMAINID key="true">domainid_data</DOMAINID>and
    <VALUE key="true">value_data</VALUE>I'm not sure if I'm syntactically challenged or just not using the correct tags.
    If I try to just generate the first two tags, forgetting the following nesting, I'm OK, as long as I don't try to assign attributes to the DOMAINID tag:
    SELECT  XMLELEMENT
    ("MAXDOMAIN",XMLATTRIBUTES('S' AS "action"),XMLELEMENT(NAME DOMAINID, "DOMAINID")
    AS "RESULT"
    FROM FAC_MAXDOMAIN;This works and is pretty trivial.
    <MAXDOMAIN action="S"><DOMAINID>AIRFLOWTYPE</DOMAINID></MAXDOMAIN>
    etc, etc...However, this:
    SELECT  XMLELEMENT
    ("MAXDOMAIN",XMLATTRIBUTES('S' AS "action"),XMLELEMENT(NAME DOMAINID, "DOMAINID",XMLATTRIBUTES('true' AS "key"))
    AS "RESULT"
    FROM FAC_MAXDOMAIN;Yields an ORA-00907: missing right parenthesis error.
    Any ideas? maybe a good primer on SQL/XML might be the best solution...
    TIA,
    Paolo

    Very nice for a first post in terms of data included and formatting.
    It took me a few minutes to see it, but the simple answer is you are putting the XMLAttributes in the wrong location. See the XMLElement spec at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions220.htm#SQLRF06168 that shows XMLAttributes comes between the identifier and value. So that means you should have written it as
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    SQL> WITH FAC_MAXDOMAIN AS
      2  (SELECT 'domainid_data' domainid, 'dscr' description,
      3          'type' domaintype, '10' maxtype, '5' length
      4     FROM dual)
      5  -- Using WITH so didn't have to create your table locally
      6  SELECT  XMLELEMENT("MAXDOMAIN",
      7            XMLATTRIBUTES('S' AS "action"),
      8            XMLELEMENT(NAME DOMAINID, XMLATTRIBUTES('true' AS "key"), "DOMAINID")
      9          )
    10  AS "RESULT"
    11  FROM FAC_MAXDOMAIN;
    RESULT
    <MAXDOMAIN action="S"><DOMAINID key="true">domainid_data</DOMAINID></MAXDOMAIN>

  • A very basic sql xml question..

    I want to print only two rows group by grup number so there are only two group numbers
    0 and 1...
    so 0 group should have two items...
    Elapsed: 00:00:00.01
    15:15:55 SQL>
    15:15:56 SQL> l
      1  with data as
      2    (select 0 as grp,'A' item_name , 'XX' Item_desc from dual
      3     union
      4      select 0 ,'B'  , 'XY'  from dual
      5      union
      6      select 1 ,'B'  , 'Y'  from dual
      7       )
      8  select xmlelement(name "grp",
      9            xmlforest(grp  "item_name",item_name)
    10            )
    11*  from data
    15:15:57 SQL> /
    XMLELEMENT(NAME"GRP",XMLFOREST(GRP"ITEM_NAME",ITEM_NAME))
    <grp><item_name>0</item_name><ITEM_NAME>A</ITEM_NAME></grp>
    <grp><item_name>0</item_name><ITEM_NAME>B</ITEM_NAME></grp>
    <grp><item_name>1</item_name><ITEM_NAME>B</ITEM_NAME></grp>
    Elapsed: 00:00:00.01

    Hi,
    You should use XMLAGG, to get everything into a single XML element. And DON'T use extract()!!
    Something like:
    SQL> declare
       xml   xmltype;
    begin
      with data as
        (select 0 grp, 'g1' grp_name, 'A' item_name, 'XX' item_desc from dual union all
         select 0    ,  'g1' grp_name,'B'          , 'XY'           from dual union all
         select 0    ,  'g2' grp_name,'B'          , 'XY'           from dual union all
         select 0    ,  'g3' grp_name,'B'          , 'XY'           from dual union all
         select 1    ,  'g1' grp_name,'B'          , 'Y'            from dual)
    -- end of test data    
         select xmlagg(xmlelement("GRP"
                                 ,xmlagg(xmlelement("ITEM_NAME", item_name))
                                 ,xmlagg(xmlelement("item_desc", item_desc))))
           into xml
           from data
       group by grp, grp_name, item_name;
       dbms_output.put_line(dbms_lob.getlength(xml.getclobval()));
    end;
    299
    PL/SQL procedure successfully completed.Regards
    Peter

  • Scripting Question - Very Basic

    Hello, I'm using the trial version of InDesign and am wondering if because it's the trial version that I can't load custom scripts from Adobe?  I've downloaded and installed a Custom Calendar script [I can see the extracted files in/on my PC] but the app apparently doesn't see it.  Any help you can offer is greatly appreciated.  Thanks, 

    Thank you so much, you were spot on. 
    From: Peter Spier <[email protected]>
    To: Friar5 <[email protected]>
    Sent: Monday, December 12, 2011 3:18 PM
    Subject: Scripting Question - Very Basic
    Re: Scripting Question - Very Basic created by Peter Spier in InDesign - View the full discussion
    Have you put thew script in a location that InDesign uses for scripts? See How to install scripts in InDesign | InDesignSecrets
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4079869#4079869
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4079869#4079869. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Basic Hyperion Workspace question

    Is there any way to Drill-Down to data by double-clicking on the chart item in Hyperion Workspace? I can do this in Hyperion Reporting Studio.

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Basic recording/feedback question

    I'm recording basic vocals against accompaniment tracks using an APOGEE ONE and Audio-Technica 40 series AT8449 condenser mic. I use only headphones, no external speakers.
    If I record with "monitoring" on I constantly battle feedback/distortion, especially on songs with a wide dynamic range. When the feedback protection kicks in the message indicates that I'm getting feedback through my external speakers (which I don't have), I can minimize the problem by turning "monitoring" off but I lose the reference vocal. I know I must be overlooking something very simple. Any help is appreciated.

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Basic PDF/SSL Question

    Okay, I know this is a basic question, and I'm not sure if this is really where I should be posting it, but maybe someone out there has experience with this.
    I have a PDF form sitting on a secure server.  I have it set up to email the completed PDF back to our company when the user clicks the SUBMIT buttton.  Whether or not the PDF is secure coming back to us would be dependent on the email server the user uses - not that the form sits in a secure area on our server or that the PDF is security settings are set, correct?
    Any input appreciated.
    Thanks
    Q

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • Basic Clone database question

    hi all,
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.
    Hope u understand
    Thanks,
    Neerav

    hi all,Hi Neerav
    I have very basic clone database question
    If i create database A and clone database B using A...
    I want to know that any operation done on A will be automatically done on Cloned database B.Oops....Now you're asking about rocket science. Sorry, I don't know.
    I know about some basics:
    Streams or Replication--> Which can give you data on B in read-write mode.
    DR--> For safeguarding your database and B will work as DR solution.
    Hope u understandNo, please make us understand.
    Regards,
    S.K.

  • One very basic question about inheritance

    One very basic question about inheritance.
    Why we need inheritance?
    the benefit of inheritance also achieve by creating instance of base class using it in other class instead of extending the base class.
    Can any one please explain why we are using inheritance instead of creating object of base class????

    SumitThokal wrote:
    One very basic question about inheritance.
    Why we need inheritance?
    the benefit of inheritance also achieve by creating instance of base class using it in other class instead of extending the base class.
    Can any one please explain why we are using inheritance instead of creating object of base class????What did you find out when you looked on Google?
    One example of inheritance comes in the form of a vehicle. Each vehicle has similarities however they differ in their own retrospect. A car is not a bus, a bus is not a truck, and a truck is not a motorbike. If you can define the similarities between these vehicles then you have a class in which you can extend into either of the previous mentioned vehicles. Resulting in a reusable class, dramatically reduces the size of code, creates a single point of definition, increases maintainability, you name it.
    In short there are thousands of benefits from using inheritance, listing the benefits could take a while. A quick Google search should give you a few hundred k if not million links to read.
    Mel

  • If I upgrade to Mountain Lion on the computer that will install it, will my WIFI still work on the computer that cannot be upgraded? I know this is a very basic question

    If I upgrade to Mountain Lion on the computer that will install it, will my WIFI still work on the computer that cannot be upgraded? I know this is a very basic question. Trying to hold out as long as I can, but purchasing an iPhone for Christmas and new iMac next year when warrently expires.

    Thank U very much for the quick reply, I wanted to upgrade this weekend, but still on the fence. I can live with the software that is not compatible, they are on another compuetr, just didn't want the obvious stuff to stop working.

Maybe you are looking for

  • Loud static on left speaker when playing music

    Well I have officially tried everything in my power to fix this problem. it is probably not much to some, but nonetheless i am annoyed by this software. anytime i wish to play anything on iTunes 7, only LOUD static comes out of the left speaker of my

  • Failed to use command "getElementAttribute" in webDrvier.

    Hi Microsoft guys, I have written a practice to learn IEDC webDriver (based on the webdriver C# demo) Everything worked ok but failed during using 'getElementAttribute' WorkFlow: 1. open "http://www.bing.com" - passed 2. find element for "input[name=

  • Everything quitting...

    I have what seems to be a serious issue, cause I can't seem to resolve this after 2 days, and nights. My finder/Preferences quits on me when I try to select any other playback app. Logic pro quits on me every time I try to open it , Quicktime quits o

  • Number range for serial Number in production order

    Hi all,             I want to use the Serial Number in production Order ... It should be generated automatically ... when i try this system creating the serial number from 1.....i want the number to start from 2000000 , How to configure this number r

  • Access Portal Services within Web Dynpro

    Hi, I created a portal service and would like that some values of the same have to be set by a Web Dynpro application, but i have a problem to access this service. Always that a i try to get a reference of this service the object isn't instantiated a