Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 15, 2013, 02:53 PM   #1
DavidBlack
macrumors 6502
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
How display memory stats on Label

Ok I am a average cocoa developer and I am making a app that purge memory. But I want to display the macs memory stats e.g inactive free and wired memory. But I have been having trouble also I want that while the purge command is being run I want the mac to run a progress bar can anyone help me? I have also posted a snapshot.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2013-04-15 at 3.48.09 PM.png
Views:	62
Size:	207.0 KB
ID:	407942  
DavidBlack is offline   0 Reply With Quote
Old Apr 15, 2013, 04:47 PM   #2
Sonnestah
Banned
 
Join Date: Mar 2013
Sure, what code do you currently have and what exactly is the issue you're having?
Sonnestah is offline   0 Reply With Quote
Old Apr 15, 2013, 05:04 PM   #3
DavidBlack
Thread Starter
macrumors 6502
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
Quote:
Originally Posted by Sonnestah View Post
Sure, what code do you currently have and what exactly is the issue you're having?
Yea sure i used the code from this:
http://stackoverflow.com/questions/6...e-activity-mon

But I can't get it to work.
DavidBlack is offline   0 Reply With Quote
Old Apr 15, 2013, 05:11 PM   #4
Sonnestah
Banned
 
Join Date: Mar 2013
The code looks just fine, whats the issue/error youre having/getting?
Sonnestah is offline   0 Reply With Quote
Old Apr 16, 2013, 02:09 PM   #5
DavidBlack
Thread Starter
macrumors 6502
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
Quote:
Originally Posted by Sonnestah View Post
Sure, what code do you currently have and what exactly is the issue you're having?
I am not sure how to implemented it to connect with a label
DavidBlack is offline   0 Reply With Quote
Old Apr 16, 2013, 02:17 PM   #6
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Quote:
Originally Posted by DavidBlack View Post
I am not sure how to implemented it to connect with a label
It looks like that code already sets a label, called memLabel, to store that text. So stick it in your controller and hook up an outlet called memLabel to your label in your XIB file.
ArtOfWarfare is offline   0 Reply With Quote
Old Apr 16, 2013, 02:38 PM   #7
DavidBlack
Thread Starter
macrumors 6502
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
Thanks I will try it
DavidBlack is offline   0 Reply With Quote
Old Apr 30, 2013, 02:52 PM   #8
DavidBlack
Thread Starter
macrumors 6502
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
Quote:
Originally Posted by ArtOfWarfare View Post
It looks like that code already sets a label, called memLabel, to store that text. So stick it in your controller and hook up an outlet called memLabel to your label in your XIB file.
Thanks but it looks like this still is not working or maybe I am doing something wrong. Can you help I have included the source code if you want to edit or help me.
Please thanks in advance.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2013-04-30 at 3.48.55 PM.png
Views:	29
Size:	470.3 KB
ID:	410265   Click image for larger version

Name:	Screen Shot 2013-04-30 at 3.50.40 PM.png
Views:	37
Size:	41.3 KB
ID:	410266  
Attached Files
File Type: zip MemTest.zip (82.5 KB, 4 views)
DavidBlack is offline   0 Reply With Quote
Old Apr 30, 2013, 10:18 PM   #9
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
For future reference, please just post the relevant code between [code] and [/ code] tags so it appears right in your post... it's easier to read than having to open a thumbnail. You included the error message, so that's good.

Your error message says it all - there's no property for an NSTextField called text. If you open up the class reference, you can see that that's so, but also, at the top of the class reference, they mention a method by name that I think you'll find helpful. Have a look for yourself, it's in the Overview section:

NSTextField Class Reference

(By the way, you should learn to check the class references. Just Google the name of the class and "Class Reference" and the first result will almost always be the official documentation on the class straight from Apple, and they'll almost always have exactly the information that you want to use the class.)
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
ArtOfWarfare is offline   0 Reply With Quote
Old May 11, 2013, 11:14 PM   #10
DavidBlack
Thread Starter
macrumors 6502
 
Join Date: Jan 2013
Location: Somewhere In Apple's HQ ;)
I found not why how to do this can you help me?
I want it to be similar to activity monitor.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2013-05-12 at 12.13.21 AM.png
Views:	7
Size:	22.4 KB
ID:	411870  
DavidBlack is offline   0 Reply With Quote
Old May 12, 2013, 12:21 AM   #11
Sonnestah
Banned
 
Join Date: Mar 2013
You need to be more specific, David. I dont think anyone will code your app for you. So please be more specific
Sonnestah is offline   0 Reply With Quote
Old May 12, 2013, 08:35 AM   #12
Ap0ks
macrumors regular
 
Join Date: Aug 2008
Location: Cambridge, UK
Quote:
Originally Posted by DavidBlack View Post
Thanks but it looks like this still is not working or maybe I am doing something wrong. Can you help I have included the source code if you want to edit or help me.
Please thanks in advance.
Using [_memTest setStringValue:[my variable stringValue]]; should fix the error you're getting in your screenshot.
Ap0ks is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone: Home screen widget that display system stats seanwebb68 Jailbreaks and iOS Hacks 1 Feb 20, 2014 11:09 AM
MBA Mid-2013 - Display Bezel Label Variations MountainFlyer MacBook Air 6 Nov 7, 2013 08:16 AM
OSX Server - Memory stats wrong? 5pencer Mac OS X Server, Xserve, and Networking 0 Jun 5, 2013 05:11 PM
iPad 2 display with memory-effect? iKnackwurst iPad Tips, Help and Troubleshooting 0 Aug 18, 2012 06:13 AM
Display numbers in Label with objects and loop animefx iPhone/iPad Programming 3 Jul 12, 2012 12:37 PM

Forum Jump

All times are GMT -5. The time now is 05:18 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC