Help on "Programming with Objective-C Exercise.
I'm working through the "Programming with Objective-C exercise and in the chapter "Working with Objects," there is a question to use the factory method as follows:
Implement the XYZPerson class person factory method you declared in the previous chapter, to return a correctly allocated and initialized instance of the XYZPerson class, then use the method in main() instead of your nested allocand init.
Tip: Rather than using [[XYZPerson alloc] init] in the class factory method, instead try using [[self alloc] init].Using self in a class factory method means that you’re referring to the class itself.This means that you don’t have to override the person method in the XYZShoutingPerson implementation to create the correct instance. Test this by checking that:
XYZShoutingPerson *shoutingPerson = [XYZShoutingPerson person];creates the correct type of object.
I'm not sure how to impliment the "person" method.
My code looks as follows:
-(void)person
[[self alloc]init];
After this I get various error messages when I try to change the code.
What is the benefit of using this initiation versus the [[XYZPerson alloc]init]; ?
Thank you.
I tried that but i got an error message: "result expression unused".
+(void)person
[[self alloc] init];
in my main.m file,
XYZShoutingPerson *shoutingPerson = [XYZShoutingPerson person];
also gives me an error message "innitializing 'XYZShoutingPerson * __strong' with an expression og incompadible type 'void'
this is the link to the page from which I found the exercise.
https://developer.apple.com/library/mac/documentation/cocoa/conceptual/Programmi ngWithObjectiveC/WorkingwithObjects/WorkingwithObjects.html#//apple_ref/doc/uid/ TP40011210-CH4-SW1
Similar Messages
-
Need Help for Array with Object
hey there guys... am trying to complete my project which is to create a Library System. Was able to create a list to show the books available when they select the book and click a borrow button it can print out the book.
what problem i have now is that when a student click borrow... the value how can i transfer to an array inside the object student.
i am usin a main screen (ms) who is controlling all the functions. been trying and trying on this for very long hopefully there will be those who are able to help me out.
my customer screen would be like this... but how can i add in the array for books borrowed
import javax.swing.*;
class Customer
private String name;
private int accNo;
private String password;
private double balance;
private Books borrow[]=new Books[5];
int borrowCount=0;
static int customerCount=0;
private MainScreen ms;
Customer(String n, int no, String p, double b)
name=n;
accNo=no;
password=p;
balance=b;
customerCount++;
JOptionPane.showMessageDialog(null,name +" record created");
display();
/* Trying to Create the Array to store information
public void setStudentBorrow(String a)
borrow[borrowCount]=a;
borrowCount++;
JOptionPane.showMessageDialog(null,"Book Borrowed");
public String getStudentBorrow()
for(int i=0;i<borrowCount-1;i++)
{ return borrow; }
public String getPassword()
{ return password; }
public String getName()
{ return name; }
public int getAccNo()
{ return accNo; }
public double getBalance()
{ return balance; }
public void setName(String n)
{ name=n; }
public void setPassword(String p)
{ password=p; }
public void setBalance(double b)
{ balance=b; }
public void setAccNo(int no)
{ accNo=no; }
public void display()
JOptionPane.showMessageDialog(null,
"\nCutomer Number : "+ customerCount+
"\nName :"+name+
"\nAccount Number: "+accNo+
"\nBalance (RM): "+balance,"Customer record",
JOptionPane.INFORMATION_MESSAGE );Cross Post:
http://forum.java.sun.com/thread.jspa?threadID=779224&messageID=4433689#4433689 -
Module pool with object oriented programming
can anyone send me links for module pool with object oriented programming.
hi,
some helful links.
Go through the below links,
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
<u>Sample std pgms.</u>
ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
Rgds
Reshma -
HELP! PDF objects - How to create a program line object?
Hi Experts,
I would like to know how to create a Program lines object (icon cog wheels). I need to create additional coding inside the context tab but when I try to right click on a folder --> create -->graphic,address,text,alternative...single record... No
program lines can be created.
Hope someone could help me.
Thanks,
JeffThere are two ways of doing it, depending on what you want to accomplish. Both require that you edit the file ~/.bashrc (I assume you use bash)
1) If the application places all the executable files in a given directory (let's say /opt/Application/bin/), you can access all those executables directly by simply telling your shell where to look (in the same way the shell automatically looks for executable files in eg. /usr/bin). In ~/.bashrc, you would have to add a line that looks like this:
PATH="$PATH:/opt/Application/bin"
2) If you just want to make a traditional "shortcut" that executes a given command, this can be done with alias. Add this command to your ~/.bashrc:
alias shortcut="some command"
In this case, typing shortcut into a terminal will be interpreted just like if you had typed some command instead.
In order to try out these changes, either restart your terminal or run this command:
source ~/.bashrc
[EDIT]
I was obviously beaten to it
Last edited by Peanut (2009-05-26 23:12:47) -
This was all working yesterday, but this morning, I cannot run in the dev fabric, or even setting the website project as a startup project directly, I get the following error:
Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'msshrtmi' could not be loaded.
=== Pre-bind state information ===
LOG: User = Andrew-VAIO\Andrew
LOG: DisplayName = msshrtmi
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: msshrtmi | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Andrew/Desktop/Beko2011Azure/Website/
LOG: Initial PrivatePath = C:\Users\Andrew\Desktop\Beko2011Azure\Website\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Andrew\Desktop\Beko2011Azure\Website\web.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/cb955b02/eef106e2/msshrtmi.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/cb955b02/eef106e2/msshrtmi/msshrtmi.DLL.
LOG: Attempting download of new URL file:///C:/Users/Andrew/Desktop/Beko2011Azure/Website/bin/msshrtmi.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +144
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +618
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +209
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +94
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +332
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677
[HttpException (0x80004005): Could not load file or assembly 'msshrtmi' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9079228
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258
Note that the dev machine is x64 Win7.
I have not tried deploying this to staging since the issue started as I'm a bit nervous of touching the staging/live environment until this is solved.
Removing the PlatformTarget element from the project file has no effect
Removing the msshrtmi.dll file from the bin directory of the website project ends up with
'Could not load file or assembly 'Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified'
I have used Git to revert to the last working build to no effect (But I don't have the obj/bin folders in GIT), but it has atleast reset the project files etc.
If I return msshrtmi.dll to the bin folder and switch the model and website projects to x64 there is no change
If I switch both to x86 then I get an error Could not load file or assembly 'BekoModel2011' or one of its dependencies. An attempt was made to load a program with an incorrect format.
which is the model project - presumably because to run on my x64 machine I need the 64bit version?
I really need to be able to debug and then publish some changes ASAP.
AndrewHi,
Is it true that you're using IIS to host the application? Could you check whether the process is x64 or x86 one via task manager or config in IIS manager?
http://blogs.msdn.com/b/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx
Allen Chen [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!
Select the text, and open the Appearance palette (Come on guys, text highlight is irrelevant, it happens to objects too says the OP), and see what's listed there. For a simple text object, there should only be a line item "Type", followed by "Characters", and when double-clicked the Characters line item expands to tell you the stroke and fill color. For a basic object, there should be a fill and/or stroke.
What happens sometimes, is that you end up adding extra strokes/fills to objects or text, and the appearance palette is where that will be noted. Especially when you are dealing with groups, and/or picking up a color with the eyedropper, you may inadvertently be adding a fill or stroke on top of something. You can drag those unwanted thingies from the Appearance palette into its own little trash can. -
firefox is not able to load any websites... i tried everything given in the support forum under the topic firefox is not able to load any websites but other programs can.. but still i am facing the same problem. so please help me out with this issue!!
firefox is not able to load any websites... i tried everything given in the support forum under the topic firefox is not able to load any websites but other programs can.. but still i am facing the same problem. so please help me out with this issue!!
-
Program with authorization object
Hi Experts,
I have an issue regarding rules and authorization.
I have created a program with 2 radio buttons transfer and backload. The requirement in authorization is not all users can access both; some can only access transfer and some can access backload only. (r_trans,r_back)
The basis told me that they need an authorization object in order for them to block/separate the transaction for transfer and backload.
Is there a way for me to modify the program and put an authorization object with my radio button? or is it possible to do this with the current program?
Thanks!Hi,
Thanks for the reply,
Our basis is using PFCG for roles and authorization , how can they check if my authorization object was created using that code?
Here is my code: Im getting sy-subrc = 12.
IF r_trans EQ 'X'.
AUTHORITY-CHECK OBJECT 'ZACTIVITY'
ID 'ACTVT' FIELD '01'.
IF sy-subrc NE '0'.
MESSAGE 'User not authorized' TYPE 'S'.
LEAVE LIST-PROCESSING.
ELSE.
MESSAGE 'User is authorized' TYPE 'S'.
LEAVE LIST-PROCESSING.
ENDIF.
ELSEIF r_back EQ 'X'.
AUTHORITY-CHECK OBJECT 'ZACTIVITY'
ID 'ACTVT' FIELD '02'.
IF sy-subrc NE '0'.
MESSAGE 'User not authorized' TYPE 'S'.
ELSE.
MESSAGE 'User is authorized' TYPE 'S'.
ENDIF.
ENDIF. -
Who has the book:Object-Oriented Programming with ABAP Objects
Hello everyone
Now i want to learn ABAP OO,and Lots' of guys told me that the book Object-Oriented Programming with ABAP Objects is realy a good book.but i searched on the net,and could not got PDF of this book,could some one gave me the net address if you know where to download the book or send me to my Mailbox:<email id removed by moderator>,I will very glad to receive any response from you,
of course,if you have some advise on how to learn ABAP OO or some other material ,hope you could share your meaning with me, hope to receive your response.
Best regards!
From Carl
Moderator message : Moved to career center.
Edited by: Vinod Kumar on Aug 27, 2011 9:21 AMI'm sure you're not asking for illegal, "free" downloads. You can legally purchase the book, also in electronic format, at sap-press.com
Thomas -
get the following message when trying to download iTunes, " program C:\program files (x86)\itunes\ituneshelper.exe" R6034 attempt to load the C runtime library incorrectly, any help or experience with this?
Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
(99280) -
Help! Can't open Labview program with MATLAB codes !!!
They used to work! But today I just can't open any LabView program with MATLAB codes in. This also happened some time ago, but after a day I tried again, it went back to normal. Can anyone help me fix it? Many thanks !!!
Hello BLpig,
Thank you for your inquiry regarding problems opening a VI. It sounds like a VI containing MATLAB code will not open in LabVIEW. This problem can happen when using LabVIEW 7 on a Windows 2000 machine. Assuming this is your setup, the following link is a great resource when dealing with this issue.
http://digital.ni.com/public.nsf/websearch/4475BC3CEB062C9586256D750058F14B?OpenDocument
Other resources similar to this can be found on the ni.com website by clicking the support tab at the top of the home page. Then search for �open vi matlab� from Technical Resources at the top of the page or topics similar to this. I hope these resources help. Let me know if I can further assist you.
Shea C.
Applications Engineering -
photoshop keeps crashing...saying an attempt was made to load a program with incorrect format. Can anyone help?
You can
Supply pertinent information for quicker answers
The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
Adobe product and version number
Operating system and version number
The full text of any error message(s)
What you were doing when the problem occurred
Screenshots of the problem
Computer hardware, such as CPU; GPU; amount of RAM; etc. -
I want parameters with f4 help for program names in value request
I want parameters with f4 help for program names in value request
points will be awarded if usefullv_name1 TYPE name1, "Vendor Name
CALL FUNCTION 'POPUP_TO_SEARCH_VALUE'
EXPORTING
textline1 = 'Vendor Name'(f09)
titel = 'Enter'(f17)
valuelength = 35
IMPORTING
value = lv_name1.
try this out .. -
Running 10.4.11 and trying to restore OS9 as well as iLife etc. I tried to install iLifer from the original disc and the computer doesn't open the install program with the .mpkg file extension. Can you help?
Hi Barbara,
Try Pacifist...
http://www.charlessoft.com/
then extract/install what you need from your Install Disc. -
Applet doesn't work with object tags--PLZ HELP!
<NOEMBED>
</NOEMBED>
</EMBED>
</COMMENT>
</OBJECT>ooops! The applet is not displayed with object tags generated by HtmlConverter utility, The applet is supposed to display a JTable and connect to Oracle DB using JDBC. The web server is Tomcat 4.1.29
<OBJECT
classid = "clsid:CAFEEFAC-0014-0001-0002-BBCDEFFEDCBA"
codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_1_02a-windows-i586.cab#Version=1,4,1,21"
WIDTH = 800 HEIGHT = 500 NAME = "Edit Trunks" >
<PARAM NAME = CODE VALUE = "cbhtolApplet.class" >
<PARAM NAME = ARCHIVE VALUE = "trnkapplet.jar,ojdbc14.jar" >
<PARAM NAME = NAME VALUE = "Edit Trunks" >
<PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.1_02a">
<PARAM NAME = "scriptable" VALUE = "false">
<COMMENT>
<EMBED
type = "application/x-java-applet;jpi-version=1.4.1_02a"
CODE = "cbhtolApplet.class"
ARCHIVE = "trnkapplet.jar,ojdbc14.jar"
NAME = "Edit Trunks"
WIDTH = 800
HEIGHT = 500
scriptable = false
pluginspage = "http://java.sun.com/products/plugin/index.html#download">
<NOEMBED>
</NOEMBED>
</EMBED>
</COMMENT>
</OBJECT>Appreciate your help!
Maybe you are looking for
-
I recently purchase an ipad2. I also have a mac laptop. Now, when I facetime call using my iphone to my ipad2 or mac, it states busy. how can i fix this problem? I have the same apple id e mail for both ipad2 and mac. it might be getting confuse
-
Mac Mini Newbie seeks LCD Display Info
Hi Am about to purchase a Mac Mini. Wondering if I can utilise an LCD TV as my display rather than pay out for an Apple Display? What Max Resolution will I achieve? Will it be comparable to an Apple Display? Any other advice from people whom have don
-
Outlook 2010 SP1 Profile Does Not Update After Moving Mailbox Between Exchange 2010 SP2 Sites
I am working on a large mailbox migration from one AD site to another. Exchange version at both sites:Exchange 2010 SP2 Two Mailbox Servers: MBX01 in site A / MBX02 in site B (There is a DAG but keeping this simple) Two CAS Arrays: CASA.domain.com /
-
Signature file doesn't exist in Cache Status Patch Manageme
When I try to update cache for patch MS11-003 Cumulative Security Update for Internet Explorer 7 Dynamic Installer for Windows XP (KB2482017) cache status displays failed and error detail displays Signature file doesn't exist. Does anyone know how re
-
I shoot A LOT with my iPhone. Yesterday my iPhone died, after re-charging it i turned it back on. It said "re-building photo library", once it was done. 2 months worth of pictures were gone, including a family vacation album. really really frustrated