UnKnown Error
qiyu
ios objective-c performance 2014-2-17 2:02:36
This question already has an answer here:Difference between self.ivar and ivar?4 answers@interface Person : NSObject @property(nonatomic, assign) CGFloat salary; @end@implementation Person – (void)addSalary:(CGFloat)s {_salary += s; **//method 1**self.salary += s; **//method 2** } @endI wonder which is more efficient between method 1 and 2? Would the compiler do some optimisation work to make them have the same performance?
qegal
iphone objective-c ios cocoa-touch retina-display 2014-2-17 1:03:57
I Have an app full of images, but when you run it on retina displays it gets pixelized, I have the same images with double resolution, but I don’t know ho to add them to my project…
rmaddy
ios uiview extend util 2014-2-16 23:54:02
I would like to add one property to UIView. I know I could subclass an UIView but as I want to add onelly one property I would like just to extend it.I try like this :@interface UIView (Util) @property(nonatomic, assign) BOOL isShow; @end@implementation UIView (Util) @dynamic isShow;-(void)setIsShow:(BOOL)isShow{self.isShow = isShow; } @endbut it doesn’t work. It throw an exception : Thread 1: EXC_BAD_ACCESS(code=2,address,…)
John Topley
ios objective-c xcode uikit segue 2014-2-16 18:21:33
Can someone more knowledgeable than I explain performSegueWithIdentifier:sender: for me? I need to switch views (and classes) and also carry a few NSStrings and IDs over to that view’s class. I was wondering if this is possible with performSegueWithIdentifier:sender:Thanks!
Jim
ios objective-c automatic-ref-counting sudzc 2014-2-16 17:07:32
Edit – I’ve tracked the below issue to a 64-bit vs 32-bit architecture issue… see my posted answer for how I resolvedI’ve used SudzC to generate SOAP code for a web service. They supply you with a sample application, which I was able to use successfully, both on device and simulator.I then started building out my app. I imported the SudzC generated files into a new XCode project using the blank application template (with CoreData and ARC enabled).I got the first SOAP request up and running —
Luke Taylor
iphone ios objective-c ipad 2014-2-16 16:24:35
I’m starting to code for iOS and I was wondering, say if I read user provided password value as such:NSString* strPwd = UITextField.text;//Check ‘strPwd’ …//How to clear out ‘strPwd’ from RAM?I just don’t like leaving sensitive data “dangling” in the RAM. Any idea how to zero it out?
Thomas Clayson
ios key-value-observing 2014-2-16 15:33:04
Whenever a property on my object is changed or updated I want to change a variable (nonce variable). This nonce is time-based. So everytime a property is updated this nonce gets updated to the current time.Is there any way to automatically listen for all key changes on my object? Or will I have to manually maintain all keyvalue observers for each property separately?Many thanks
Till
iphone ios memory-management 2014-2-16 14:48:19
I’m interesting a size of memory, allocing with some Objective-C classes. For example : Is [NSString stringWithString:@”2″] bigger than [NSNumber numberWithInt:2] or not? And how much [NSNumber numberWithInt:2] bigger than int num=2 ? Are there some documentation from Apple about this question? I think, this information is very important for memory optimisation.
Yar
objective-c ios 2014-2-16 14:35:44
Note: This other question seems relevant but it’s not: When does an associated object get released?I’m adding a second description to a UIView instance as follows:- (void) setSecondDescription:(UIView*)view description2:(NSString*)description2 {objc_setAssociatedObject (view,&key,description2,OBJC_ASSOCIATION_RETAIN); }- (NSString*) secondDescription:(UIView*)view {return (id)objc_getAssociatedObject(view, &key); }If the UIView deallocs, will the associated description 2 get dealloced
rmaddy
ios objective-c methods boilerplate 2014-2-16 14:33:29
I have a simple UIViewController with 9 UIImageViews. When each UIImageView is pressed a method (or function) is called. This all works fine but the problem is that I have too much boiler plate code now.In my viewDidLoad method I have 9 UITapGestureRecognizer to detect when any of my 9 UIImageViews are pressed. They then call a method to run. Here is my code:UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imagepressed1:)]; [picview_1 addGesture
PaulDaviesC
linux memory c function 2014-2-16 22:57:28
I wrote a simple program as below and straced it.#include<stdio.h> int foo(int i) {int k=9;if(i==10)return 1;elsefoo(++i);open(“1”,1); } int main() {foo(1); }My intention in doing so was to checkout how is memory allocated for the variables (int k in this case) in a function on a stack. I used an open system call as a marker. The output of strace was as below:execve(“./a.out”, [“./a.out”], [/* 25 vars */]) = 0 brk(0) = 0x8653000 access(“/etc/ld.so.nohwcap”,
ioeric
c++ c memory operating-system 2014-2-16 17:01:19
I was doing some experiments on the heap address growth, and something interesting happened. (OS: CentOS, ) But I don’t understand, why this happened? Thanks!This is what I did first:double *ptr[1000]; for (int i=0;i<1000;i++){ptr[i] = new double[**10000**];cout << ptr[i] << endl; }The output is incremental(for the last few lines):…. …. 0x2481be0 0x2495470 0x24a8d00 0x24bc590 0x24cfe20 0x24e36b0 0x24f6f40 0x250a7d0 0x251e060Then I changed 10000 to 20000:double *ptr[1000]; for
sharptooth
c++ visual-c++ memory heap-fragmentation 2014-2-16 15:17:44
Heap fragmentation can cause a server application that is expected to run continuously for many months to suddenly start malfunctioning thinking that it’s out of memory.Let’s assume that I’ve done my best to minimize runtime heap fragmentation in my VC++ server application but still it builds up and causes problems. I could for example automatically restart the application every month or every half million requests processed – safely stop it and safely start again with a new heap. What else can
Faken
debugging visual-c++ memory inspector 2014-2-16 14:58:39
I’m using Intel Inspector to check for memory issues with my program and I keep running into “uninitialized memory access” errors in the MSVCR90D.dll modules but when I click on that error, it says no source could be displayed. Any ideas what I’m doing wrong to cause this to happen?I have a suspicion that it has something to do with my read in/output functions but how can I be sure?
zeion
c memory memory-management memory-address 2014-2-16 14:05:19
Is it possible to print out what is stored at a specific memory address? For example I want to know what is stored at the address 0x7FFFFF0. How would I do this? I do not know what is stored at the address before hand ie. it could be an int or char or a null terminator.
Bhesh Gurung
java performance memory garbage-collection jvm 2014-2-16 8:15:04
I have a Map in memory that stores my objects. I’d like to flush to memory when I’m running out of memory. I’m doing this right now:void add(K key, V value) {if (underPressure()) {flush(innerMap);}innerMap.add(k, v); }boolean underPressure() {Runtime rt = Runtime.getRuntime();long maxMemory = rt.maxMemory();long freeMemory = rt.freeMemory();return (double) freeMemory / maxMemory < threshold; }As underPressure() is called at each insert, how expensive is it? To my understanding, as it’s an app
thelight
performance delphi memory delphi-7 delphi-xe 2014-2-16 6:05:43
Is there a real performance gain when I turn {$IMPORTEDDATA} off ?The manual only says this: “The {$G-} directive disables creation of imported data references. Using {$G-} increases memory-access efficiency, but prevents a packaged unit where it occurs from referencing variables in other packages.”Update:Here is more info I could find:”The Debugging section has the new option Use imported data references (mapped to $G), which controls the creation of imported data references (increasing memory
glaz666
java memory tomcat 2014-2-15 23:02:05
I know there are several memory types that Tomcat uses when running.The only I have ever used – java heap. It can be controlled through JAVA_OPTS env property with something like ‘-Xmx128M -Xms64M’I have found that there is also -XX:MaxPermSize, -XX:MaxNewSize and etc.The reason I’m asking is that I’m trying to launch Tomcat5.5 on 200Mb RAM memory (it is VPS server). I have setup java heap size with ‘-Xmx128M -Xms64M’, but it seems that right from startup it consumes more than that (if ever can
Java Enthusiast
java string memory memory-management garbage-collection 2014-2-15 21:07:48
Profiling the application I figured out that there are a lot of strings on heap. In my situation, strings are created on heap and not interned and they are not literals. Are there are specific GC tuning techniques to follow when the number of strings in the application are very high. I stumbled across the GC settings -XX:+UseCompressedStrings or -XX+UseStringCache but not sure this will help. Did any body try these settings?java version “1.6.0_22” Java(TM) SE Runtime Environment (build 1.6.0_22-
Bo Persson
java linux memory operating-system ram 2014-2-15 10:59:30
I’m new to Linux and have a question about memory limitations. As I know, in Windows you can only have 2.8 GB used in the 32bit version of OS, but what about Linux – is it 4 GB or less too?I’m particularly interested in Java application run in RHEL5. But if you have answers about other technologies – that would be awesome to listen to.